浏览代码

core: only change the nonce if the account nonce is lower

obscuren 10 年之前
父节点
当前提交
cf5ad266f6
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      core/transaction_pool.go

+ 3 - 1
core/transaction_pool.go

@@ -69,7 +69,9 @@ func (pool *TxPool) Start() {
 
 		for _, tx := range pool.pending {
 			if addr, err := tx.From(); err == nil {
-				pool.state.SetNonce(addr, tx.Nonce())
+				if pool.state.GetNonce(addr) < tx.Nonce() {
+					pool.state.SetNonce(addr, tx.Nonce())
+				}
 			}
 		}