From 3ddf58c70d33f85c9d3521f34e4c3fba0deca1e3 Mon Sep 17 00:00:00 2001 From: Determinant Date: Wed, 16 Sep 2020 23:46:18 -0400 Subject: add the missing IsMultiCoin assignment --- core/state/statedb.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'core') diff --git a/core/state/statedb.go b/core/state/statedb.go index b472bd7..81be542 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -579,10 +579,11 @@ func (s *StateDB) getDeletedStateObject(addr common.Address) *stateObject { return nil } data = &Account{ - Nonce: acc.Nonce, - Balance: acc.Balance, - CodeHash: acc.CodeHash, - Root: common.BytesToHash(acc.Root), + Nonce: acc.Nonce, + Balance: acc.Balance, + CodeHash: acc.CodeHash, + IsMultiCoin: acc.IsMultiCoin, + Root: common.BytesToHash(acc.Root), } if len(data.CodeHash) == 0 { data.CodeHash = emptyCodeHash -- cgit v1.2.3-70-g09d2 From 160a8f543b3a2e9ed38f806015e4f1f0d1f49f8d Mon Sep 17 00:00:00 2001 From: Determinant Date: Thu, 17 Sep 2020 01:36:24 -0400 Subject: revert the SetTail logic --- core/blockchain.go | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'core') diff --git a/core/blockchain.go b/core/blockchain.go index b3a7ffa..82e3b6c 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -2492,13 +2492,12 @@ func (bc *BlockChain) SubscribeBlockProcessingEvent(ch chan<- bool) event.Subscr } func (bc *BlockChain) ManualHead(hash common.Hash) error { - return bc.FastSyncCommitHead(hash) - //block := bc.GetBlockByHash(hash) - //if block == nil { - // return errors.New("block not found") - //} - //bc.chainmu.Lock() - //defer bc.chainmu.Unlock() - //bc.writeHeadBlock(block) - //return nil + block := bc.GetBlockByHash(hash) + if block == nil { + return errors.New("block not found") + } + bc.chainmu.Lock() + defer bc.chainmu.Unlock() + bc.writeHeadBlock(block) + return nil } -- cgit v1.2.3-70-g09d2 From 6b4efa7ff5537a7cdb1d73b18dd75f56bdadc032 Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Thu, 17 Sep 2020 09:20:36 -0400 Subject: Fix potential nil pointer dereference --- core/types/block.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'core') diff --git a/core/types/block.go b/core/types/block.go index 99d6cc8..0a93601 100644 --- a/core/types/block.go +++ b/core/types/block.go @@ -330,6 +330,9 @@ func (b *Block) SetExtraData(data []byte) { } func (b *Block) ExtraData() []byte { + if b.extdata == nil { + return nil + } return *b.extdata } -- cgit v1.2.3-70-g09d2