0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-03-05 14:06:27 -05:00
bitcoin-core/src
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
..
bench
common
compat
consensus
crc32c
crypto
index
init
interfaces
ipc
kernel
leveldb
logging
minisketch
node
policy
primitives
qt
rpc
script
secp256k1
support
test
univalue
util
wallet
zmq
.clang-format
.clang-tidy
addrdb.cpp
addrdb.h
addresstype.cpp
addresstype.h
addrman.cpp
addrman.h
addrman_impl.h
arith_uint256.cpp
arith_uint256.h
attributes.h
banman.cpp
banman.h
base58.cpp
base58.h
bech32.cpp
bech32.h
bip324.cpp
bip324.h
bitcoin-chainstate.cpp
bitcoin-cli-res.rc
bitcoin-cli.cpp
bitcoin-tx-res.rc
bitcoin-tx.cpp
bitcoin-util-res.rc
bitcoin-util.cpp
bitcoin-wallet-res.rc
bitcoin-wallet.cpp
bitcoind-res.rc
bitcoind.cpp
blockencodings.cpp
blockencodings.h
blockfilter.cpp
blockfilter.h
chain.cpp
chain.h
chainparams.cpp
chainparams.h
chainparamsbase.cpp
chainparamsbase.h
chainparamsseeds.h
checkqueue.h
clientversion.cpp
clientversion.h
cluster_linearize.h
CMakeLists.txt
coins.cpp
coins.h
compressor.cpp
compressor.h
core_io.h
core_memusage.h
core_read.cpp
core_write.cpp
cuckoocache.h
dbwrapper.cpp
dbwrapper.h
deploymentinfo.cpp
deploymentinfo.h
deploymentstatus.cpp
deploymentstatus.h
dummywallet.cpp
external_signer.cpp
external_signer.h
flatfile.cpp
flatfile.h
hash.cpp
hash.h
headerssync.cpp
headerssync.h
httprpc.cpp
httprpc.h
httpserver.cpp
httpserver.h
i2p.cpp
i2p.h
indirectmap.h
init.cpp
init.h
key.cpp
key.h
key_io.cpp
key_io.h
logging.cpp
logging.h
mapport.cpp
mapport.h
memusage.h
merkleblock.cpp
merkleblock.h
net.cpp
net.h
net_permissions.cpp
net_permissions.h
net_processing.cpp
net_processing.h
net_types.cpp
net_types.h
netaddress.cpp
netaddress.h
netbase.cpp
netbase.h
netgroup.cpp
netgroup.h
netmessagemaker.h
noui.cpp
noui.h
outputtype.cpp
outputtype.h
pow.cpp
pow.h
prevector.h
protocol.cpp
protocol.h
psbt.cpp
psbt.h
pubkey.cpp
pubkey.h
random.cpp
random.h
randomenv.cpp
randomenv.h
rest.cpp
rest.h
scheduler.cpp
scheduler.h
serialize.h
signet.cpp
signet.h
span.h
streams.cpp
streams.h
sync.cpp
sync.h
threadsafety.h
tinyformat.h
torcontrol.cpp
torcontrol.h
txdb.cpp
txdb.h
txmempool.cpp
txmempool.h
txorphanage.cpp
txorphanage.h
txrequest.cpp
txrequest.h
uint256.cpp
uint256.h
undo.h
validation.cpp
validation.h
validationinterface.cpp
validationinterface.h
versionbits.cpp
versionbits.h
walletinitinterface.h