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

This commit is contained in:
obscuren 2015-06-04 15:44:42 +02:00
parent 2bb0e48a7b
commit cf5ad266f6
1 changed files with 3 additions and 1 deletions

View File

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