mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Merge 8209e86eeb into merged_master (Bitcoin PR bitcoin/bitcoin#28458)
This commit is contained in:
commit
40637b227e
10 changed files with 42 additions and 41 deletions
|
|
@ -915,9 +915,10 @@ bool BlockManager::FindUndoPos(BlockValidationState& state, int nFile, FlatFileP
|
|||
bool BlockManager::WriteBlockToDisk(const CBlock& block, FlatFilePos& pos) const
|
||||
{
|
||||
// Open history file to append
|
||||
CAutoFile fileout(OpenBlockFile(pos), SER_DISK, CLIENT_VERSION);
|
||||
if (fileout.IsNull())
|
||||
CAutoFile fileout{OpenBlockFile(pos), CLIENT_VERSION};
|
||||
if (fileout.IsNull()) {
|
||||
return error("WriteBlockToDisk: OpenBlockFile failed");
|
||||
}
|
||||
|
||||
// Write index header
|
||||
unsigned int nSize = GetSerializeSize(block, fileout.GetVersion());
|
||||
|
|
@ -969,9 +970,10 @@ bool BlockManager::ReadBlockFromDisk(CBlock& block, const FlatFilePos& pos) cons
|
|||
block.SetNull();
|
||||
|
||||
// Open history file to read
|
||||
CAutoFile filein(OpenBlockFile(pos, true), SER_DISK, CLIENT_VERSION);
|
||||
if (filein.IsNull())
|
||||
CAutoFile filein{OpenBlockFile(pos, true), CLIENT_VERSION};
|
||||
if (filein.IsNull()) {
|
||||
return error("ReadBlockFromDisk: OpenBlockFile failed for %s", pos.ToString());
|
||||
}
|
||||
|
||||
// Read block
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue