re: #19793 (review)
should the other corruption reasons also latch to true?
wss.corrupt
would never be set to false, so the error TOO_NEW
is translated to the error CORRUPT
(after at least one CORRUPT error).
With a lost key this doesn’t seem to happen and the error might be rewritten to TOO_NEW.
Probably doesn’t matter in practice, but I wanted to ask to be sure.
Looking at the calling code, in practice the wallet will fail to load either way if TOO_NEW or CORRUPT is returned, only the error text will be different. It’s not even a new thing for the CORRUPT error to take priority over the TOO_NEW error since it can also happen in other the places result = DBErrors::CORRUPT
is set below.
But one somewhat ugly side effect of this is it can make gArgs.SoftSetBoolArg("-rescan", true)
line not get called consistency. It would really be better not to do this and for rescan status were passed back more directly, but that requires more changes outside the file.