aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/blockchain.go17
-rw-r--r--core/state/statedb.go9
-rw-r--r--core/types/block.go3
3 files changed, 16 insertions, 13 deletions
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
}
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
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
}