mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-22 23:07:59 +01:00
validation: Use existing chain member in CChainState::AcceptBlock
This commit is contained in:
parent
fee73347c0
commit
5e4af77380
1 changed files with 2 additions and 1 deletions
|
@ -3787,8 +3787,9 @@ bool CChainState::AcceptBlock(const std::shared_ptr<const CBlock>& pblock, Block
|
||||||
|
|
||||||
// Write block to history file
|
// Write block to history file
|
||||||
if (fNewBlock) *fNewBlock = true;
|
if (fNewBlock) *fNewBlock = true;
|
||||||
|
assert(std::addressof(::ChainActive()) == std::addressof(m_chain));
|
||||||
try {
|
try {
|
||||||
FlatFilePos blockPos = SaveBlockToDisk(block, pindex->nHeight, ::ChainActive(), chainparams, dbp);
|
FlatFilePos blockPos = SaveBlockToDisk(block, pindex->nHeight, m_chain, chainparams, dbp);
|
||||||
if (blockPos.IsNull()) {
|
if (blockPos.IsNull()) {
|
||||||
state.Error(strprintf("%s: Failed to find position to write new block to disk", __func__));
|
state.Error(strprintf("%s: Failed to find position to write new block to disk", __func__));
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue