aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2020-09-19 19:48:22 -0400
committerDeterminant <[email protected]>2020-09-19 19:48:22 -0400
commitad82b990891525a754ebfe9155292b23408c9652 (patch)
treed086460a88df296ec866ab1b73627c50b8567b0a
parent80f76ae97372ea074ce660dbcaffd97c648ece22 (diff)
auto-enable multicoin in AddBalanceMultiCoinv0.3.1-rc.2
-rw-r--r--core/state/statedb.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/state/statedb.go b/core/state/statedb.go
index 81be542..dbf0870 100644
--- a/core/state/statedb.go
+++ b/core/state/statedb.go
@@ -425,6 +425,9 @@ func (s *StateDB) SetBalance(addr common.Address, amount *big.Int) {
// AddBalance adds amount to the account associated with addr.
func (s *StateDB) AddBalanceMultiCoin(addr common.Address, coinID common.Hash, amount *big.Int) {
+ if !s.IsMultiCoin(addr) {
+ s.EnableMultiCoin(addr)
+ }
stateObject := s.GetOrNewStateObject(addr)
if stateObject != nil {
stateObject.AddBalanceMultiCoin(coinID, amount, s.db)