Skip to content

Commit

Permalink
bypass 0 amount in cctx and corrected Mumbai's chain_id
Browse files Browse the repository at this point in the history
  • Loading branch information
ws4charlie committed Sep 22, 2023
1 parent 6461d37 commit 9c1364d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion zetaclient/btc_signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,12 @@ func (signer *BTCSigner) SignWithdrawTx(to *btcutil.AddressWitnessPubKeyHash, am
remaining := total - amount
remainingSats, err := getSatoshis(remaining)
if err != nil {
return nil, err
// TODO: amount validation should be done in zeta core to block invalid cctx
// We ignore invalid amount for now, otherwise it will block all other cctxes
// 'remaining' is supposed to be > 0 as we have checked total >= amount + fees
validSendSofar = false
signer.logger.Error().Err(err).Msgf("SignWithdrawTx: cannot convert remaining amount %f to satoshis", remaining)
//return nil, err
}
remainingSats -= fees.Int64()
remainingSats -= nonceMark
Expand Down
6 changes: 3 additions & 3 deletions zetaclient/evm_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,9 +408,9 @@ func (ob *EVMChainClient) IsSendOutTxProcessed(sendHash string, nonce uint64, co

// The lowest nonce we observe outTx for each chain
var lowestOutTxNonceToObserve = map[int64]uint64{
5: 70000, // Goerli
97: 95000, // BSC testnet
8001: 120000, // Matic
5: 70000, // Goerli
97: 95000, // BSC testnet
80001: 120000, // Matic
}

// FIXME: there's a chance that a txhash in OutTxChan may not deliver when Stop() is called
Expand Down

0 comments on commit 9c1364d

Please sign in to comment.