MCPcopy Create free account
hub / github.com/CPChain/chain / WriteBlockWithoutState

Method WriteBlockWithoutState

core/blockchain.go:1043–1050  ·  view source on GitHub ↗

WriteBlockWithoutState writes only the block and its metadata to the database, but does not write any state. This is used to construct competing side forks up to the point where they exceed the canonical total difficulty.

(block *types.Block, td *big.Int)

Source from the content-addressed store, hash-verified

1041// but does not write any state. This is used to construct competing side forks
1042// up to the point where they exceed the canonical total difficulty.
1043func (bc *BlockChain) WriteBlockWithoutState(block *types.Block, td *big.Int) (err error) {
1044 bc.wg.Add(1)
1045 defer bc.wg.Done()
1046
1047 rawdb.WriteBlock(bc.db, block)
1048
1049 return nil
1050}
1051
1052// WriteBlockWithState writes the block and all associated state to the database.
1053func (bc *BlockChain) WriteBlockWithState(block *types.Block, pubReceipts []*types.Receipt, privReceipts []*types.Receipt,

Callers 1

insertChainMethod · 0.95

Calls 1

AddMethod · 0.65

Tested by

no test coverage detected