Skip to content

Commit

Permalink
fix nonce too high problem (#95)
Browse files Browse the repository at this point in the history
Co-authored-by: weiqiang.fan <[email protected]>
  • Loading branch information
fanweiqiang and weiqiang.fan authored Mar 26, 2024
1 parent 53a8055 commit 87e3340
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions claimtxman/claimtxman_xlayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,14 @@ func (tm *ClaimTxManager) monitorTxsXLayer(ctx context.Context) error {
mTxLog.Infof("nonce cache cleared for address %v", mTx.From.Hex())
}
}
if err.Error() == pool.ErrNonceTooHigh.Error() {
mTxLog.Infof("nonce error detected, Nonce used: %d", signedTx.Nonce())
if !isResetNonce {
isResetNonce = true
tm.nonceCache.Remove(mTx.From.Hex())
mTxLog.Infof("nonce cache cleared for address %v", mTx.From.Hex())
}
}
mTx.RemoveHistory(signedTx)
// we should rebuild the monitored tx to fix the nonce
err := tm.ReviewMonitoredTxXLayer(ctx, &mTx)
Expand Down

0 comments on commit 87e3340

Please sign in to comment.