Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
11b56ace
Unverified
Commit
11b56ace
authored
May 05, 2022
by
milesvant
Committed by
GitHub
May 05, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: fix WriteBlockAndSetHead documentation (#24818)
parent
992151fa
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
blockchain.go
core/blockchain.go
+4
-4
No files found.
core/blockchain.go
View file @
11b56ace
...
...
@@ -1266,7 +1266,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
...
...
@@ -1276,9 +1277,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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment