MCPcopy Create free account
hub / github.com/ElementsProject/elements / FindUndoPos

Method FindUndoPos

src/node/blockstorage.cpp:682–702  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

680}
681
682bool BlockManager::FindUndoPos(BlockValidationState& state, int nFile, FlatFilePos& pos, unsigned int nAddSize)
683{
684 pos.nFile = nFile;
685
686 LOCK(cs_LastBlockFile);
687
688 pos.nPos = m_blockfile_info[nFile].nUndoSize;
689 m_blockfile_info[nFile].nUndoSize += nAddSize;
690 m_dirty_fileinfo.insert(nFile);
691
692 bool out_of_space;
693 size_t bytes_allocated = UndoFileSeq().Allocate(pos, nAddSize, out_of_space);
694 if (out_of_space) {
695 return AbortNode(state, "Disk space is too low!", _("Disk space is too low!"));
696 }
697 if (bytes_allocated != 0 && fPruneMode) {
698 m_check_for_pruning = true;
699 }
700
701 return true;
702}
703
704static bool WriteBlockToDisk(const CBlock& block, FlatFilePos& pos, const CMessageHeader::MessageStartChars& messageStart)
705{

Callers

nothing calls this directly

Calls 5

UndoFileSeqFunction · 0.85
_Function · 0.85
AbortNodeFunction · 0.50
insertMethod · 0.45
AllocateMethod · 0.45

Tested by

no test coverage detected