Merge a55904a80c into merged_master (Bitcoin PR bitcoin/bitcoin#21866)

Paying the piper for some lazy use of globals, including ones I added
in 8e770d3f21

Had to add another couple methods to interfaces::Chain
This commit is contained in:
Andrew Poelstra 2021-07-29 13:18:11 +00:00
commit 34da23bd1a
41 changed files with 270 additions and 365 deletions

View file

@ -249,7 +249,6 @@ bool FindBlockPos(FlatFilePos& pos, unsigned int nAddSize, unsigned int nHeight,
// when the undo file is keeping up with the block file, we want to flush it explicitly
// when it is lagging behind (more blocks arrive than are being connected), we let the
// undo block write case handle it
assert(std::addressof(::ChainActive()) == std::addressof(active_chain));
finalize_undo = (vinfoBlockFile[nFile].nHeightLast == (unsigned int)active_chain.Tip()->nHeight);
nFile++;
if (vinfoBlockFile.size() <= nFile) {