From ad82b990891525a754ebfe9155292b23408c9652 Mon Sep 17 00:00:00 2001 From: Determinant Date: Sat, 19 Sep 2020 19:48:22 -0400 Subject: auto-enable multicoin in AddBalanceMultiCoin --- core/state/statedb.go | 3 +++ 1 file changed, 3 insertions(+) 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) -- cgit v1.2.3-70-g09d2