| 680 | } |
| 681 | |
| 682 | bool 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 | |
| 704 | static bool WriteBlockToDisk(const CBlock& block, FlatFilePos& pos, const CMessageHeader::MessageStartChars& messageStart) |
| 705 | { |
nothing calls this directly
no test coverage detected