aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-06-04 21:44:42 +0800
committerobscuren <geffobscura@gmail.com>2015-06-04 21:44:42 +0800
commitcf5ad266f6b8b7dd4800b63404c0efe680d47673 (patch)
tree6e5e4f239dfa72bdd0179094f56edaebe27abbb4 /core
parent2bb0e48a7bbeb374536e313b3c3b4922ba305818 (diff)
downloadgo-tangerine-cf5ad266f6b8b7dd4800b63404c0efe680d47673.tar
go-tangerine-cf5ad266f6b8b7dd4800b63404c0efe680d47673.tar.gz
go-tangerine-cf5ad266f6b8b7dd4800b63404c0efe680d47673.tar.bz2
go-tangerine-cf5ad266f6b8b7dd4800b63404c0efe680d47673.tar.lz
go-tangerine-cf5ad266f6b8b7dd4800b63404c0efe680d47673.tar.xz
go-tangerine-cf5ad266f6b8b7dd4800b63404c0efe680d47673.tar.zst
go-tangerine-cf5ad266f6b8b7dd4800b63404c0efe680d47673.zip
core: only change the nonce if the account nonce is lower
Diffstat (limited to 'core')
-rw-r--r--core/transaction_pool.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/transaction_pool.go b/core/transaction_pool.go
index c59eaa061..a0f3c326a 100644
--- a/core/transaction_pool.go
+++ b/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())
+ }
}
}