mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-18 13:17:55 +02:00
Merge 42fd503819 into merged_master (Bitcoin PR #18786)
This commit is contained in:
commit
8c572c898e
3 changed files with 12 additions and 6 deletions
|
|
@ -4981,7 +4981,7 @@ bool LoadGenesisBlock(const CChainParams& chainparams)
|
|||
return ::ChainstateActive().LoadGenesisBlock(chainparams);
|
||||
}
|
||||
|
||||
bool LoadExternalBlockFile(const CChainParams& chainparams, FILE* fileIn, FlatFilePos *dbp)
|
||||
void LoadExternalBlockFile(const CChainParams& chainparams, FILE* fileIn, FlatFilePos* dbp)
|
||||
{
|
||||
// Map of disk positions for blocks with unknown parent (only used for reindex)
|
||||
static std::multimap<uint256, FlatFilePos> mapBlocksUnknownParent;
|
||||
|
|
@ -4993,7 +4993,7 @@ bool LoadExternalBlockFile(const CChainParams& chainparams, FILE* fileIn, FlatFi
|
|||
CBufferedFile blkdat(fileIn, 2*MAX_BLOCK_SERIALIZED_SIZE, MAX_BLOCK_SERIALIZED_SIZE+8, SER_DISK, CLIENT_VERSION);
|
||||
uint64_t nRewind = blkdat.GetPos();
|
||||
while (!blkdat.eof()) {
|
||||
boost::this_thread::interruption_point();
|
||||
if (ShutdownRequested()) return;
|
||||
|
||||
blkdat.SetPos(nRewind);
|
||||
nRewind++; // start one byte further next time, in case of failure
|
||||
|
|
@ -5098,9 +5098,7 @@ bool LoadExternalBlockFile(const CChainParams& chainparams, FILE* fileIn, FlatFi
|
|||
} catch (const std::runtime_error& e) {
|
||||
AbortNode(std::string("System error: ") + e.what());
|
||||
}
|
||||
if (nLoaded > 0)
|
||||
LogPrintf("Loaded %i blocks from external file in %dms\n", nLoaded, GetTimeMillis() - nStart);
|
||||
return nLoaded > 0;
|
||||
LogPrintf("Loaded %i blocks from external file in %dms\n", nLoaded, GetTimeMillis() - nStart);
|
||||
}
|
||||
|
||||
void CChainState::CheckBlockIndex(const Consensus::Params& consensusParams)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue