cmd/geth, core, light, mobile: removed state account StartingNonce

All account's nonce start at 0.
This commit is contained in:
Jeffrey Wilcke
2016-11-20 12:18:39 +01:00
parent a0e42aa4e2
commit aad4890082
7 changed files with 5 additions and 33 deletions

View File

@ -34,10 +34,6 @@ import (
lru "github.com/hashicorp/golang-lru"
)
// The starting nonce determines the default nonce when new accounts are being
// created.
var StartingNonce uint64
// Trie cache generation limit after which to evic trie nodes from memory.
var MaxTrieCacheGen = uint16(120)
@ -239,7 +235,7 @@ func (self *StateDB) GetNonce(addr common.Address) uint64 {
return stateObject.Nonce()
}
return StartingNonce
return 0
}
func (self *StateDB) GetCode(addr common.Address) []byte {
@ -423,7 +419,7 @@ func (self *StateDB) MarkStateObjectDirty(addr common.Address) {
func (self *StateDB) createObject(addr common.Address) (newobj, prev *StateObject) {
prev = self.GetStateObject(addr)
newobj = newObject(self, addr, Account{}, self.MarkStateObjectDirty)
newobj.setNonce(StartingNonce) // sets the object to dirty
newobj.setNonce(0) // sets the object to dirty
if prev == nil {
if glog.V(logger.Core) {
glog.Infof("(+) %x\n", addr)