diff options
author | bas-vk <bas-vk@users.noreply.github.com> | 2016-12-11 06:54:58 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2016-12-11 06:54:58 +0800 |
commit | 4e36b1e3dadda62a53e309a1b6cf7aed97ea7a3a (patch) | |
tree | cf54f3d14e4ac9f177b6951f92f898d8c7c9a744 /internal/ethapi/backend.go | |
parent | 0fe35b907addf1c066cb4d7c717bb23f9f2e7be4 (diff) | |
download | go-tangerine-4e36b1e3dadda62a53e309a1b6cf7aed97ea7a3a.tar.gz go-tangerine-4e36b1e3dadda62a53e309a1b6cf7aed97ea7a3a.tar.zst go-tangerine-4e36b1e3dadda62a53e309a1b6cf7aed97ea7a3a.zip |
core: bugfix state change race condition in txpool (#3412)
The transaction pool keeps track of the current nonce in its local pendingState. When a
new block comes in the pendingState is reset. During the reset it fetches multiple times
the current state through the use of the currentState callback. When a second block comes
in during the reset its possible that the state changes during the reset. If that block
holds transactions that are currently in the pool the local pendingState that is used to
determine nonces can get out of sync.
Diffstat (limited to 'internal/ethapi/backend.go')
-rw-r--r-- | internal/ethapi/backend.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/ethapi/backend.go b/internal/ethapi/backend.go index 77df7eb8d..36d7e754b 100644 --- a/internal/ethapi/backend.go +++ b/internal/ethapi/backend.go @@ -55,7 +55,7 @@ type Backend interface { // TxPool API SendTx(ctx context.Context, signedTx *types.Transaction) error RemoveTx(txHash common.Hash) - GetPoolTransactions() types.Transactions + GetPoolTransactions() (types.Transactions, error) GetPoolTransaction(txHash common.Hash) *types.Transaction GetPoolNonce(ctx context.Context, addr common.Address) (uint64, error) Stats() (pending int, queued int) |