bitcoin/src/wallet
Ava Chow 85f96b01b7
Merge bitcoin/bitcoin#30909: wallet, assumeutxo: Don't Assume m_chain_tx_count, Improve wallet RPC errors
9d2d9f7ce2 rpc: Include assumeutxo as a failure reason of rescanblockchain (Fabian Jahr)
595edee169 test, assumeutxo: import descriptors during background sync (Alfonso Roman Zubeldia)
d73ae603d4 rpc: Improve importdescriptor RPC error messages (Fabian Jahr)
27f99b6d63 validation: Don't assume m_chain_tx_count in GuessVerificationProgress (Fabian Jahr)
42d5d53363 interfaces: Add helper function for wallet on pruning (Fabian Jahr)

Pull request description:

  A test that is added as part of #30455 uncovered this issue: The `GuessVerificationProgress` function is used during during descriptor import and relies on `m_chain_tx_count`. In #29370 an [`Assume` was added](0fd915ee6b) expecting the `m_chaint_tx_count` to be set. However, as the test uncovered, `GuessVerificationProgress` is called with background sync blocks that have `m_chaint_tx_count = 0` when they have not been downloaded and processed yet.

  The simple fix is to remove the `Assume`. Users should not be thrown off by the `Internal bug detected` error. The behavior of `importdescriptor` is kept consistent with the behavior for blocks missing due to pruning.

  The test by alfonsoromanz is cherry-picked here to show that the [CI errors](https://cirrus-ci.com/task/5110045812195328?logs=ci#L2535) should be fixed by this change.

  This PR also improves error messages returned by the `importdescriptors` and `rescanblockchain` RPCs. The error message now changes depending on the situation of the node, i.e. if pruning is happening or an assumutxo backgroundsync is active.

ACKs for top commit:
  achow101:
    ACK 9d2d9f7ce2
  mzumsande:
    Code Review ACK 9d2d9f7ce2
  furszy:
    Code review ACK 9d2d9f7ce2

Tree-SHA512: b841a9b371e5eb8eb3bfebca35645ff2fdded7a3e5e06308d46a33a51ca42cc4c258028c9958fbbb6cda9bb990e07ab8d8504dd9ec6705ef78afe0435912b365
2025-01-31 15:45:14 -05:00
..
rpc Merge bitcoin/bitcoin#30909: wallet, assumeutxo: Don't Assume m_chain_tx_count, Improve wallet RPC errors 2025-01-31 15:45:14 -05:00
test Merge bitcoin/bitcoin#31242: wallet, desc spkm: Return SigningProvider only if we have the privkey 2025-01-16 17:30:36 +00:00
bdb.cpp scripted-diff: LogPrint -> LogDebug 2024-08-29 13:49:57 +02:00
bdb.h wallet: introduce active db txn listeners 2024-10-21 08:29:22 -03:00
CMakeLists.txt cmake: Add systemtap-sdt optional package support 2024-08-16 19:27:41 +01:00
coincontrol.cpp wallet: Explicitly preserve scriptSig and scriptWitness in CreateTransaction 2023-12-08 17:12:19 -05:00
coincontrol.h [wallet, rpc]: add max_tx_weight to tx funding options 2024-06-27 15:31:21 +01:00
coinselection.cpp Remove unused variable assignment 2024-12-13 21:00:07 -06:00
coinselection.h Merge bitcoin/bitcoin#29523: Wallet: Add max_tx_weight to transaction funding options (take 2) 2024-07-17 18:27:59 -04:00
context.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
context.h interfaces: Add schedulerMockForward method so mockscheduler RPC can work across processes 2023-10-20 10:30:16 -04:00
crypter.cpp refactor: vector -> span in CCrypter 2024-08-28 19:09:51 +02:00
crypter.h refactor: vector -> span in CCrypter 2024-08-28 19:09:51 +02:00
db.cpp Merge bitcoin/bitcoin#29071: refactor: Remove Span operator==, Use std::ranges::equal 2024-08-28 10:34:47 +01:00
db.h wallet: introduce active db txn listeners 2024-10-21 08:29:22 -03:00
dump.cpp bdb: Be able to make byteswapped databases 2024-05-16 15:03:13 -04:00
dump.h wallettool: Don't create CWallet when dumping DB 2023-12-19 16:54:06 -05:00
external_signer_scriptpubkeyman.cpp util: add TransactionError includes and namespace declarations 2024-05-16 10:16:08 -05:00
external_signer_scriptpubkeyman.h common: Add PSBTError enum 2024-05-16 10:16:08 -05:00
feebumper.cpp scripted-diff: Replace strprintf(Untranslated) with Untranslated(strprintf) 2024-12-04 15:09:05 -04:00
feebumper.h rpc: bumpfee, improve doc for 'reduce_output' arg 2023-09-26 20:17:02 -03:00
fees.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
fees.h
init.cpp scripted-diff: drop config/ subdir for bitcoin-config.h, rename to bitcoin-build-config.h 2024-10-10 12:22:12 +02:00
interfaces.cpp gui: Use wallet name for wallet migration rather than WalletModel 2024-08-13 11:25:38 -04:00
load.cpp refactor: Delay translation of _() literals 2025-01-14 19:21:37 +01:00
load.h interfaces: Add schedulerMockForward method so mockscheduler RPC can work across processes 2023-10-20 10:30:16 -04:00
migrate.cpp refactor: Drop unused UCharCast 2025-01-14 19:01:53 +01:00
migrate.h wallet: introduce active db txn listeners 2024-10-21 08:29:22 -03:00
receive.cpp [clang-tidy] Enable the misc-no-recursion check 2024-04-07 14:04:45 +01:00
receive.h wallet: Add wallet/types.h for simple public enum and struct types 2023-04-11 15:52:25 -04:00
salvage.cpp scripted-diff: Replace strprintf(Untranslated) with Untranslated(strprintf) 2024-12-04 15:09:05 -04:00
salvage.h refactor: Move fs.* to util/fs.* 2023-03-23 12:55:18 +01:00
scriptpubkeyman.cpp Merge bitcoin/bitcoin#31242: wallet, desc spkm: Return SigningProvider only if we have the privkey 2025-01-16 17:30:36 +00:00
scriptpubkeyman.h Merge bitcoin/bitcoin#31242: wallet, desc spkm: Return SigningProvider only if we have the privkey 2025-01-16 17:30:36 +00:00
spend.cpp tracing: only prepare tracepoint args if attached 2024-10-28 14:27:47 +01:00
spend.h refactor: pass CRecipient to FundTransaction 2024-01-19 15:04:56 +01:00
sqlite.cpp scripted-diff: Rename PACKAGE_* variables to CLIENT_* 2024-10-28 12:36:19 +00:00
sqlite.h wallet: introduce active db txn listeners 2024-10-21 08:29:22 -03:00
transaction.cpp scripted-diff: wallet: s/TxStateConflicted/TxStateBlockConflicted 2024-03-14 17:38:39 -04:00
transaction.h util: Move util/string.h functions to util namespace 2024-05-16 10:16:08 -05:00
types.h util: move error.h TransactionError enum to node/types.h 2024-05-16 10:16:08 -05:00
wallet.cpp Merge bitcoin/bitcoin#31241: wallet: remove BDB dependency from wallet migration benchmark 2025-01-24 18:21:50 -05:00
wallet.h Merge bitcoin/bitcoin#31241: wallet: remove BDB dependency from wallet migration benchmark 2025-01-24 18:21:50 -05:00
walletdb.cpp Merge bitcoin/bitcoin#28724: wallet: Cleanup accidental encryption keys in watchonly wallets 2025-01-10 15:29:47 +00:00
walletdb.h Merge bitcoin/bitcoin#28724: wallet: Cleanup accidental encryption keys in watchonly wallets 2025-01-10 15:29:47 +00:00
wallettool.cpp scripted-diff: Rename PACKAGE_* variables to CLIENT_* 2024-10-28 12:36:19 +00:00
wallettool.h
walletutil.cpp descriptors: Change Parse to return vector of descriptors 2024-08-08 12:47:22 -04:00
walletutil.h Merge bitcoin/bitcoin#22838: descriptors: Be able to specify change and receiving in a single descriptor string 2024-08-28 15:56:15 +01:00