refactor: Move block storage globals to blockstorage

However, keep a declaration in validation to make it possible to move
smaller chunks to blockstorage without breaking compilation.

Also, expose AbortNode in the header.

Can be reviewed with --color-moved=dimmed-zebra --color-moved-ws=ignore-all-space
This commit is contained in:
MarcoFalke
2021-04-18 15:41:08 +02:00
parent fa81c30c6f
commit fa247a327f
3 changed files with 30 additions and 16 deletions

View File

@@ -21,6 +21,23 @@ bool fHavePruned = false;
bool fPruneMode = false;
uint64_t nPruneTarget = 0;
// TODO make namespace {
RecursiveMutex cs_LastBlockFile;
std::vector<CBlockFileInfo> vinfoBlockFile;
int nLastBlockFile = 0;
/** Global flag to indicate we should check to see if there are
* block/undo files that should be deleted. Set on startup
* or if we allocate more file space when we're in prune mode
*/
bool fCheckForPruning = false;
/** Dirty block index entries. */
std::set<CBlockIndex*> setDirtyBlockIndex;
/** Dirty block file entries. */
std::set<int> setDirtyFileInfo;
// } // namespace
bool IsBlockPruned(const CBlockIndex* pblockindex)
{
return (fHavePruned && !(pblockindex->nStatus & BLOCK_HAVE_DATA) && pblockindex->nTx > 0);