Skip to content

Commit

Permalink
core: fix WriteBlockAndSetHead documentation (ethereum#24818)
Browse files Browse the repository at this point in the history
  • Loading branch information
milesvant authored and sadoci committed Jan 27, 2023
1 parent 8656a57 commit 0519d07
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -1267,7 +1267,8 @@ func (bc *BlockChain) writeBlockWithState(block *types.Block, receipts []*types.
return nil
}

// WriteBlockWithState writes the block and all associated state to the database.
// WriteBlockAndSetHead writes the given block and all associated state to the database,
// and applies the block as the new chain head.
func (bc *BlockChain) WriteBlockAndSetHead(block *types.Block, receipts []*types.Receipt, logs []*types.Log, state *state.StateDB, emitHeadEvent bool) (status WriteStatus, err error) {
if !bc.chainmu.TryLock() {
return NonStatTy, errChainStopped
Expand All @@ -1277,9 +1278,8 @@ func (bc *BlockChain) WriteBlockAndSetHead(block *types.Block, receipts []*types
return bc.writeBlockAndSetHead(block, receipts, logs, state, emitHeadEvent)
}

// writeBlockAndSetHead writes the block and all associated state to the database,
// and also it applies the given block as the new chain head. This function expects
// the chain mutex to be held.
// writeBlockAndSetHead is the internal implementation of WriteBlockAndSetHead.
// This function expects the chain mutex to be held.
func (bc *BlockChain) writeBlockAndSetHead(block *types.Block, receipts []*types.Receipt, logs []*types.Log, state *state.StateDB, emitHeadEvent bool) (status WriteStatus, err error) {
if err := bc.writeBlockWithState(block, receipts, logs, state); err != nil {
return NonStatTy, err
Expand Down

0 comments on commit 0519d07

Please sign in to comment.