aboutsummaryrefslogtreecommitdiff
path: root/core/state/statedb.go
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2020-09-16 22:54:37 -0400
committerDeterminant <[email protected]>2020-09-16 22:54:37 -0400
commited839907e592ad25e6119e145e7e05ca78b00fcd (patch)
tree1235df2fcf794c391afb33cc2dd80926469e2c7e /core/state/statedb.go
parent5370b602abea0415f7609f19e3f44d5c9366e5bd (diff)
...
Diffstat (limited to 'core/state/statedb.go')
-rw-r--r--core/state/statedb.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/state/statedb.go b/core/state/statedb.go
index 805c607..b472bd7 100644
--- a/core/state/statedb.go
+++ b/core/state/statedb.go
@@ -270,11 +270,12 @@ func (self *StateDB) GetBalanceMultiCoin(addr common.Address, coinID common.Hash
func (self *StateDB) EnableMultiCoin(addr common.Address) error {
stateObject := self.GetOrNewStateObject(addr)
if stateObject.data.Root != emptyRoot && stateObject.data.Root != zeroRoot {
- return errors.New("not a fresh account")
+ return errors.New(fmt.Sprintf("not a fresh account: %s", stateObject.data.Root.Hex()))
}
if !stateObject.EnableMultiCoin() {
return errors.New("multi-coin mode already enabled")
}
+ log.Debug(fmt.Sprintf("enabled MC for %s", addr.Hex()))
return nil
}
@@ -527,7 +528,7 @@ func (s *StateDB) updateStateObject(obj *stateObject) {
// enough to track account updates at commit time, deletions need tracking
// at transaction boundary level to ensure we capture state clearing.
if s.snap != nil {
- s.snapAccounts[obj.addrHash] = snapshot.SlimAccountRLP(obj.data.Nonce, obj.data.Balance, obj.data.Root, obj.data.CodeHash)
+ s.snapAccounts[obj.addrHash] = snapshot.SlimAccountRLP(obj.data.Nonce, obj.data.Balance, obj.data.Root, obj.data.CodeHash, obj.data.IsMultiCoin)
}
}