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)
downloaddexon-cf5ad266f6b8b7dd4800b63404c0efe680d47673.tar
dexon-cf5ad266f6b8b7dd4800b63404c0efe680d47673.tar.gz
dexon-cf5ad266f6b8b7dd4800b63404c0efe680d47673.tar.bz2
dexon-cf5ad266f6b8b7dd4800b63404c0efe680d47673.tar.lz
dexon-cf5ad266f6b8b7dd4800b63404c0efe680d47673.tar.xz
dexon-cf5ad266f6b8b7dd4800b63404c0efe680d47673.tar.zst
dexon-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())
+ }
}
}