diff --git a/zetaclient/bitcoin_client.go b/zetaclient/bitcoin_client.go index 263879fe47..312e4aabdb 100644 --- a/zetaclient/bitcoin_client.go +++ b/zetaclient/bitcoin_client.go @@ -356,15 +356,15 @@ func (ob *BitcoinChainClient) IsSendOutTxProcessed(sendHash string, nonce uint64 // Get original cctx parameters params, err := ob.GetPendingCctxParams(nonce) if err != nil { - ob.logger.ObserveOutTx.Info().Msgf("IsSendOutTxProcessed: can't find pending cctx for nonce %d", nonce) - return false, false, nil + ob.logger.ObserveOutTx.Warn().Msgf("IsSendOutTxProcessed: can't find pending cctx for nonce %d", nonce) + return false, false, err } // Try including this outTx broadcasted by myself inMempool, err := ob.checkNSaveIncludedTx(txnHash, params) if err != nil { ob.logger.ObserveOutTx.Error().Err(err).Msg("IsSendOutTxProcessed: checkNSaveIncludedTx failed") - return false, false, nil + return false, false, err } if inMempool { // to avoid unnecessary Tss keysign ob.logger.ObserveOutTx.Info().Msgf("IsSendOutTxProcessed: outTx %s is still in mempool", outTxID) @@ -391,8 +391,8 @@ func (ob *BitcoinChainClient) IsSendOutTxProcessed(sendHash string, nonce uint64 sats, err := getSatoshis(amount) if err != nil { - ob.logger.ObserveOutTx.Warn().Msgf("IsSendOutTxProcessed: getSatoshis error: %s", err) - return false, false, nil + ob.logger.ObserveOutTx.Error().Msgf("IsSendOutTxProcessed: getSatoshis error: %s", err) + return false, false, err } amountInSat := big.NewInt(sats) if res.Confirmations < ob.ConfirmationsThreshold(amountInSat) { diff --git a/zetaclient/zetacore_observer.go b/zetaclient/zetacore_observer.go index bc568816b2..1b6ecaec26 100644 --- a/zetaclient/zetacore_observer.go +++ b/zetaclient/zetacore_observer.go @@ -174,7 +174,9 @@ func (co *CoreObserver) startSendScheduler() { // Process Bitcoin OutTx if common.IsBitcoinChain(c.ChainId) { if outTxMan.IsOutTxActive(outTxID) { - break // there is no need to process cctx with future nonces + // bitcoun outTx is processed sequencially by nonce + // if the current outTx is being processed, there is no need to process outTx with future nonces + break } // #nosec G701 positive if stop := co.processBitcoinOutTx(outTxMan, uint64(idx), cctx, signer, ob, currentHeight); stop {