Go-Ethereum

為什麼我會收到“從池中移除 tx:低 tx 隨機數或資金不足”?

  • May 17, 2016

我用來送出交易的賬戶有 10490 ETH (1.0585e+22 Wei)。交易成本為 20477 Gas,Gas 價格為 300000000000。

下面是 Geth 的輸出:

I0330 22:28:05.762119 8235 transaction_pool.go:491] removed tx (
 TX(c2c8b07508b51fcd1828e312dc1ebf219c579f9bb4776ebbf462cd8b7f61e85c)
 Contract: false
 From: fa7b2db995e286e882cb4ded7b413ce4f3aa4775
 To: 1ca2b90df6bc95a0dc988b771f81a105d6b59bb5
 Nonce: 7
 GasPrice: 300000000000
 GasLimit 90000
 Value: 0
 Data: 0x1522eba7000000000000000000000000fa7b2db995e286e882cb4ded7b413ce4f3aa477500000000000000000000000000000000000000000000000000000000000000df
 V: 0x1b
 R: 0xbb2a8f533b0b729a1149aa4d30a10f72fe528050dfb22c57b43b5e20fdad0f70
 S: 0x185c5676078b14ca332a10f696c5e93a98d56ec0da10870f90216d459cf9bae8
 Hex: f8aa078545d964b80083015f90941ca2b90df6bc95a0dc988b771f81a105d6b59bb580b8441522eba7000000000000000000000000fa7b2db995e286e882cb4ded7b413ce4f3aa477500000000000000000000000000000000000000000000000000000000000000df1ba0bb2a8f533b0b729a1149aa4d30a10f72fe528050dfb22c57b43b5e20fdad0f70a0185c5676078b14ca332a10f696c5e93a98d56ec0da10870f90216d459cf9bae8
) from pool: low tx nonce or out of funds

產生此錯誤的原始碼位來自https://github.com/ethereum/go-ethereum/blob/4044a8cea44cd4cee3a8ddaf51a76b71c9d22042/core/tx_pool.go#L489-L502並在函式 tx_pool.go:validate_pool( …)。

...
if past := state.GetNonce(sender) > tx.Nonce(); past || balance.Cmp(tx.Cost()) < 0 {
   // Remove an already past it invalidated transaction
   if glog.V(logger.Core) {
       glog.Infof("removed tx (%v) from pool: low tx nonce or out of funds\n", tx)
   }
   delete(pool.pending, hash)
   ...

正如您所說,您的帳戶中有足夠的餘額,由於檢查了交易隨機數,該交易必須已被拒絕。在您發布的數據中,您的交易 nonce 為 7。必須已經有來自同一個帳戶的先前交易,其中已經使用了 7 或以上的 nonce。

引用自:https://ethereum.stackexchange.com/questions/2601