Moved handling of nonces to the managed state

This commit is contained in:
obscuren
2015-04-08 23:30:07 +02:00
parent 6e2f78ebdd
commit 204ac81188
3 changed files with 9 additions and 6 deletions

View File

@ -62,7 +62,7 @@ func (ms *ManagedState) NewNonce(addr common.Address) uint64 {
}
}
account.nonces = append(account.nonces, true)
return uint64(len(account.nonces)) + account.nstart
return uint64(len(account.nonces)-1) + account.nstart
}
// GetNonce returns the canonical nonce for the managed or unmanged account
@ -109,5 +109,5 @@ func (ms *ManagedState) getAccount(addr common.Address) *account {
}
func newAccount(so *StateObject) *account {
return &account{so, so.nonce - 1, nil}
return &account{so, so.nonce, nil}
}