@@ -476,7 +476,7 @@ CBlockFileInfo* BlockManager::GetBlockFileInfo(size_t n)
476476 return &m_blockfile_info.at (n);
477477}
478478
479- bool BlockManager::UndoWriteToDisk (const CBlockUndo& blockundo, FlatFilePos& pos, const uint256& hashBlock, const CMessageHeader::MessageStartChars& messageStart ) const
479+ bool BlockManager::UndoWriteToDisk (const CBlockUndo& blockundo, FlatFilePos& pos, const uint256& hashBlock) const
480480{
481481 // Open history file to append
482482 AutoFile fileout{OpenUndoFile (pos)};
@@ -486,7 +486,7 @@ bool BlockManager::UndoWriteToDisk(const CBlockUndo& blockundo, FlatFilePos& pos
486486
487487 // Write index header
488488 unsigned int nSize = GetSerializeSize (blockundo, CLIENT_VERSION);
489- fileout << messageStart << nSize;
489+ fileout << GetParams (). MessageStart () << nSize;
490490
491491 // Write undo data
492492 long fileOutPos = ftell (fileout.Get ());
@@ -708,7 +708,7 @@ bool BlockManager::FindUndoPos(BlockValidationState& state, int nFile, FlatFileP
708708 return true ;
709709}
710710
711- bool BlockManager::WriteBlockToDisk (const CBlock& block, FlatFilePos& pos, const CMessageHeader::MessageStartChars& messageStart ) const
711+ bool BlockManager::WriteBlockToDisk (const CBlock& block, FlatFilePos& pos) const
712712{
713713 // Open history file to append
714714 CAutoFile fileout (OpenBlockFile (pos), SER_DISK, CLIENT_VERSION);
@@ -718,7 +718,7 @@ bool BlockManager::WriteBlockToDisk(const CBlock& block, FlatFilePos& pos, const
718718
719719 // Write index header
720720 unsigned int nSize = GetSerializeSize (block, fileout.GetVersion ());
721- fileout << messageStart << nSize;
721+ fileout << GetParams (). MessageStart () << nSize;
722722
723723 // Write block
724724 long fileOutPos = ftell (fileout.Get ());
@@ -740,7 +740,7 @@ bool BlockManager::WriteUndoDataForBlock(const CBlockUndo& blockundo, BlockValid
740740 if (!FindUndoPos (state, block.nFile , _pos, ::GetSerializeSize (blockundo, CLIENT_VERSION) + 40 )) {
741741 return error (" ConnectBlock(): FindUndoPos failed" );
742742 }
743- if (!UndoWriteToDisk (blockundo, _pos, block.pprev ->GetBlockHash (), GetParams (). MessageStart () )) {
743+ if (!UndoWriteToDisk (blockundo, _pos, block.pprev ->GetBlockHash ())) {
744744 return FatalError (m_opts.notifications , state, " Failed to write undo data" );
745745 }
746746 // rev files are written in block height order, whereas blk files are written as blocks come in (often out of order)
@@ -806,7 +806,7 @@ bool BlockManager::ReadBlockFromDisk(CBlock& block, const CBlockIndex& index) co
806806 return true ;
807807}
808808
809- bool BlockManager::ReadRawBlockFromDisk (std::vector<uint8_t >& block, const FlatFilePos& pos, const CMessageHeader::MessageStartChars& message_start ) const
809+ bool BlockManager::ReadRawBlockFromDisk (std::vector<uint8_t >& block, const FlatFilePos& pos) const
810810{
811811 FlatFilePos hpos = pos;
812812 hpos.nPos -= 8 ; // Seek back 8 bytes for meta header
@@ -821,10 +821,10 @@ bool BlockManager::ReadRawBlockFromDisk(std::vector<uint8_t>& block, const FlatF
821821
822822 filein >> blk_start >> blk_size;
823823
824- if (memcmp (blk_start, message_start , CMessageHeader::MESSAGE_START_SIZE)) {
824+ if (memcmp (blk_start, GetParams (). MessageStart () , CMessageHeader::MESSAGE_START_SIZE)) {
825825 return error (" %s: Block magic mismatch for %s: %s versus expected %s" , __func__, pos.ToString (),
826826 HexStr (blk_start),
827- HexStr (message_start ));
827+ HexStr (GetParams (). MessageStart () ));
828828 }
829829
830830 if (blk_size > MAX_SIZE) {
@@ -859,7 +859,7 @@ FlatFilePos BlockManager::SaveBlockToDisk(const CBlock& block, int nHeight, cons
859859 return FlatFilePos ();
860860 }
861861 if (!position_known) {
862- if (!WriteBlockToDisk (block, blockPos, GetParams (). MessageStart () )) {
862+ if (!WriteBlockToDisk (block, blockPos)) {
863863 m_opts.notifications .fatalError (" Failed to write block" );
864864 return FlatFilePos ();
865865 }
0 commit comments