I noticed while reviewing #19085, if the wallet is due to perform a PeriodicFlush()
, but in the 2 second delay, another action occurs, i.e a call to backupwallet
, the flushing never happens.
The wallet does get flushed and db closed as part of backupwallet
(remains loaded); however this leaves the scheduler running MaybeCompactWalletDB
continually trying to flush the wallet, which now always fails because mapFileUseCount
is empty.
Note that generally, when MaybeCompactWalletDB
is called, nothing is done because:
is false. However in this case, it’s true, and we do continually descend into PeriodicFlush()
.
This is resolved whenever the next wallet related action occurs, i.e a call to getwalletinfo
, as mapFileUseCount
is repopulated, and PeriodicFlush()
succeeds.
I don’t know the wallet code well enough to know if this is a problem, or just an implementation quirk.