diff options
Diffstat (limited to 'core/blockchain.go')
-rw-r--r-- | core/blockchain.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/blockchain.go b/core/blockchain.go index 83299ceec..4940899a5 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -368,7 +368,7 @@ func (bc *BlockChain) ResetWithGenesisBlock(genesis *types.Block) { defer bc.mu.Unlock() // Prepare the genesis block and reinitialise the chain - if err := WriteTd(bc.chainDb, genesis.Hash(), genesis.Difficulty()); err != nil { + if err := bc.hc.WriteTd(genesis.Hash(), genesis.Difficulty()); err != nil { glog.Fatalf("failed to write genesis block TD: %v", err) } if err := WriteBlock(bc.chainDb, genesis); err != nil { @@ -788,7 +788,7 @@ func (self *BlockChain) WriteBlock(block *types.Block) (status WriteStatus, err status = SideStatTy } // Irrelevant of the canonical status, write the block itself to the database - if err := WriteTd(self.chainDb, block.Hash(), externTd); err != nil { + if err := self.hc.WriteTd(block.Hash(), externTd); err != nil { glog.Fatalf("failed to write block total difficulty: %v", err) } if err := WriteBlock(self.chainDb, block); err != nil { |