If a wallet has key birthdates that are more recent than the currrent chain tip, or a bestblock height higher than the current tip, we should not attempt to rescan as there is nothing to scan for.
Fixes #26655
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
See the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
3193+ }
3194+ if (time_first_key) {
3195+ FoundBlock found = FoundBlock().height(rescan_height);
3196+ chain.findFirstBlockWithTimeAndHeight(*time_first_key - TIMESTAMP_WINDOW, rescan_height, found);
3197+ if (!found.found) {
3198+ // We were unable to find a block a block that had a time more recent than our earliest timestamp
nit:
0 // We were unable to find a block that had a time more recent than our earliest timestamp
If a wallet has key birthdates that are more recent than the currrent
chain tip, or a bestblock height higher than the current tip, we should
not attempt to rescan as there is nothing to scan for.
utACK https://github.com/bitcoin/bitcoin/pull/26679/commits/378400953424598fd78ccec5ba8cc38bc253c550
Ci error seems unrelated.
3190+ for (auto spk_man : walletInstance->GetAllScriptPubKeyMans()) {
3191+ int64_t time = spk_man->GetTimeFirstKey();
3192+ if (!time_first_key || time < *time_first_key) time_first_key = time;
3193+ }
3194+ if (time_first_key) {
3195+ FoundBlock found = FoundBlock().height(rescan_height);
findFirstBlockWithTimeAndHeight
nor below.
ScanForWalletTransactions
, below?
FoundBlock
to be an inputs-only container when it’s actually the outputs container.