diff options
author | James O'Beirne <james.obeirne@pm.me> | 2022-10-07 15:08:32 -0400 |
---|---|---|
committer | James O'Beirne <james.obeirne@pm.me> | 2022-10-07 15:19:31 -0400 |
commit | 1c36bafc5f7db268546dcc86c793071a7e9d35e0 (patch) | |
tree | fc6cb8ec16b12a7cae2305f1ac4343ce6a8e9118 /src | |
parent | 73b61717a977fc9d23f1bae3f8620641a9dee1f3 (diff) | |
download | bitcoin-1c36bafc5f7db268546dcc86c793071a7e9d35e0.tar.xz |
wallet: have prune error take precedence over assumedvalid
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}"
Co-authored-by: MacroFake <MarcoFalke@gmail.com>
Co-authored-by: Russ Yanofsky <russ@yanofsky.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/wallet/wallet.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 5889de2e36..320e61028d 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3111,12 +3111,14 @@ bool CWallet::AttachChain(const std::shared_ptr<CWallet>& walletInstance, interf // If a block is pruned after this check, we will load the wallet, // but fail the rescan with a generic error. - error = chain.hasAssumedValidChain() ? - _( - "Assumed-valid: last wallet synchronisation goes beyond " - "available block data. You need to wait for the background " - "validation chain to download more blocks.") : - _("Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)"); + error = chain.havePruned() ? + _("Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)") : + strprintf(_( + "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 when using assumeutxo " + "snapshots. Wallet should be able to load successfully after " + "node sync reaches height %s"), block_height); return false; } } |