@@ -527,7 +527,7 @@ void BlockManager::FlushUndoFile(int block_file, bool finalize)
527527{
528528 FlatFilePos undo_pos_old (block_file, m_blockfile_info[block_file].nUndoSize );
529529 if (!UndoFileSeq ().Flush (undo_pos_old, finalize)) {
530- AbortNode (" Flushing undo file to disk failed. This is likely the result of an I/O error." );
530+ AbortNode (" Flushing undo file to disk failed. This is likely the result of an I/O error." , m_opts. init_error_callback );
531531 }
532532}
533533
@@ -546,7 +546,7 @@ void BlockManager::FlushBlockFile(bool fFinalize, bool finalize_undo)
546546
547547 FlatFilePos block_pos_old (m_last_blockfile, m_blockfile_info[m_last_blockfile].nSize );
548548 if (!BlockFileSeq ().Flush (block_pos_old, fFinalize )) {
549- AbortNode (" Flushing block file to disk failed. This is likely the result of an I/O error." );
549+ AbortNode (" Flushing block file to disk failed. This is likely the result of an I/O error." , m_opts. init_error_callback );
550550 }
551551 // we do not always flush the undo file, as the chain tip may be lagging behind the incoming blocks,
552552 // e.g. during IBD or a sync after a node going offline
@@ -658,7 +658,7 @@ bool BlockManager::FindBlockPos(FlatFilePos& pos, unsigned int nAddSize, unsigne
658658 bool out_of_space;
659659 size_t bytes_allocated = BlockFileSeq ().Allocate (pos, nAddSize, out_of_space);
660660 if (out_of_space) {
661- return AbortNode (" Disk space is too low!" , _ (" Disk space is too low!" ));
661+ return AbortNode (" Disk space is too low!" , m_opts. init_error_callback , _ (" Disk space is too low!" ));
662662 }
663663 if (bytes_allocated != 0 && IsPruneMode ()) {
664664 m_check_for_pruning = true ;
@@ -682,7 +682,7 @@ bool BlockManager::FindUndoPos(BlockValidationState& state, int nFile, FlatFileP
682682 bool out_of_space;
683683 size_t bytes_allocated = UndoFileSeq ().Allocate (pos, nAddSize, out_of_space);
684684 if (out_of_space) {
685- return AbortNode (state, " Disk space is too low!" , _ (" Disk space is too low!" ));
685+ return AbortNode (state, " Disk space is too low!" , m_opts. init_error_callback , _ (" Disk space is too low!" ));
686686 }
687687 if (bytes_allocated != 0 && IsPruneMode ()) {
688688 m_check_for_pruning = true ;
@@ -724,7 +724,7 @@ bool BlockManager::WriteUndoDataForBlock(const CBlockUndo& blockundo, BlockValid
724724 return error (" ConnectBlock(): FindUndoPos failed" );
725725 }
726726 if (!UndoWriteToDisk (blockundo, _pos, block.pprev ->GetBlockHash (), GetParams ().MessageStart ())) {
727- return AbortNode (state, " Failed to write undo data" );
727+ return AbortNode (state, " Failed to write undo data" , m_opts. init_error_callback );
728728 }
729729 // rev files are written in block height order, whereas blk files are written as blocks come in (often out of order)
730730 // we want to flush the rev (undo) file once we've written the last block, which is indicated by the last height
@@ -842,7 +842,7 @@ FlatFilePos BlockManager::SaveBlockToDisk(const CBlock& block, int nHeight, CCha
842842 }
843843 if (!position_known) {
844844 if (!WriteBlockToDisk (block, blockPos, GetParams ().MessageStart ())) {
845- AbortNode (" Failed to write block" );
845+ AbortNode (" Failed to write block" , m_opts. init_error_callback );
846846 return FlatFilePos ();
847847 }
848848 }
0 commit comments