Skip to content

Commit 869342f

Browse files
committed
Merge bitcoin#26282: wallet: have prune error take precedence over assumedvalid
1c36baf wallet: have prune error take precedence over assumedvalid (James O'Beirne) Pull request description: Fixes bitcoin#23997 (comment). From Russ Yanofsky: > Agree with all of Marco's points here and think this should be updated > > If havePrune and hasAssumedValidChain are both true, better to show havePrune error message. Assumed-valid error message is vague and not very actionable. Would suggest "Error loading wallet. Wallet requires blocks to be downloaded, and software does not currently support loading wallets while blocks are being downloaded out of order though assumeutxo snapshots. Wallet should be able to load successfully after node sync reaches height {block_height}" ACKs for top commit: MarcoFalke: ACK 1c36baf aureleoules: ACK 1c36baf Tree-SHA512: bfb0024bb962525cbbd392ade3c0331a8b0525e7f2f2ab52b2dbb9b6dd6311070d85ecb762a7689db84a30991971865698ab6fec187206e6a92133790c5a91dc
2 parents 9eaa5db + 1c36baf commit 869342f

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/wallet/wallet.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3111,12 +3111,14 @@ bool CWallet::AttachChain(const std::shared_ptr<CWallet>& walletInstance, interf
31113111
// If a block is pruned after this check, we will load the wallet,
31123112
// but fail the rescan with a generic error.
31133113

3114-
error = chain.hasAssumedValidChain() ?
3115-
_(
3116-
"Assumed-valid: last wallet synchronisation goes beyond "
3117-
"available block data. You need to wait for the background "
3118-
"validation chain to download more blocks.") :
3119-
_("Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)");
3114+
error = chain.havePruned() ?
3115+
_("Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)") :
3116+
strprintf(_(
3117+
"Error loading wallet. Wallet requires blocks to be downloaded, "
3118+
"and software does not currently support loading wallets while "
3119+
"blocks are being downloaded out of order when using assumeutxo "
3120+
"snapshots. Wallet should be able to load successfully after "
3121+
"node sync reaches height %s"), block_height);
31203122
return false;
31213123
}
31223124
}

0 commit comments

Comments
 (0)