bitcoin/src/bench
Andrew Chow 27dcc07c08
Merge bitcoin/bitcoin#26699: wallet, gui: bugfix, getAvailableBalance skips selected coins
68eed5df86 test,gui: add coverage for PSBT creation on legacy watch-only wallets (furszy)
306aab5bb4 test,gui: decouple widgets and model into a MiniGui struct (furszy)
2f76ac0383 test,gui: decouple chain and wallet initialization from test case (furszy)
cd98b71739 gui: 'getAvailableBalance', include watch only balance (furszy)
74eac3a82f test: add coverage for 'useAvailableBalance' functionality (furszy)
dc1cc1c359 gui: bugfix, getAvailableBalance skips selected coins (furszy)

Pull request description:

  Fixes https://github.com/bitcoin-core/gui/issues/688 and https://github.com/bitcoin/bitcoin/issues/26687.

  First Issue Description (https://github.com/bitcoin-core/gui/issues/688):

  The previous behavior for `getAvailableBalance`, when the coin control had selected coins, was to return the sum of them. Instead, we are currently returning the wallet's available total balance minus the selected coins total amount.

  Reason:
  Missed to update the `GetAvailableBalance` function to include the coin control selected coins on #25685.

  Context:
  Since #25685 we skip the selected coins inside `AvailableCoins`, the reason is that there is no need to waste resources walking through the entire wallet's txes map just to get coins that could have gotten by just doing a simple `mapWallet.find`).

  Places Where This Generates Issues (only when the user manually select coins via coin control):
  1) The GUI balance check prior the transaction creation process.
  2) The GUI "useAvailableBalance" functionality.

  Note 1:
  As the GUI uses a balance cache since https://github.com/bitcoin-core/gui/pull/598, this issue does not affect the regular spending process. Only arises when the user manually select coins.

  Note 2:
  Added test coverage for the `useAvailableBalance` functionality.

  ----------------------------------

  Second Issue Description (https://github.com/bitcoin/bitcoin/issues/26687):

  As we are using a cached balance on `WalletModel::getAvailableBalance`,
  the function needs to include the watch-only available balance for wallets
  with private keys disabled.

ACKs for top commit:
  Sjors:
    tACK 68eed5df86
  achow101:
    ACK 68eed5df86
  theStack:
    ACK 68eed5df86

Tree-SHA512: 674f3e050024dabda2ff4a04b9ed3750cf54a040527204c920e1e38bd3d7f5fd4d096e4fd08a0fea84ee6abb5070f022b5c0d450c58fd30202ef05ebfd7af6d3
2023-04-11 14:05:55 -04:00
..
data
.gitignore
addrman.cpp
base58.cpp
bech32.cpp
bench.cpp refactor: Move fs.* to util/fs.* 2023-03-23 12:55:18 +01:00
bench.h refactor: Move fs.* to util/fs.* 2023-03-23 12:55:18 +01:00
bench_bitcoin.cpp refactor: Move fs.* to util/fs.* 2023-03-23 12:55:18 +01:00
block_assemble.cpp
ccoins_caching.cpp
chacha20.cpp Only support 32-byte keys in ChaCha20{,Aligned} 2023-01-30 18:12:21 -05:00
chacha_poly_aead.cpp
checkblock.cpp
checkqueue.cpp refactor: Use move semantics in `CCheckQueue::Loop` 2023-03-21 13:04:21 +00:00
coin_selection.cpp wallet: single output groups filtering and grouping process 2023-03-06 09:45:40 -03:00
crypto_hash.cpp Merge bitcoin/bitcoin#15294: refactor: Extract RipeMd160 2023-01-30 09:49:01 +01:00
data.cpp
data.h
descriptors.cpp
duplicate_inputs.cpp
examples.cpp
gcs_filter.cpp Fix clang-tidy readability-const-return-type violations 2023-02-01 11:33:35 +01:00
hashpadding.cpp
load_external.cpp Use DataStream where possible 2023-01-26 10:44:05 +01:00
lockedpool.cpp clang-tidy: Add `performance-inefficient-vector-operation` check 2023-03-26 20:17:55 +01:00
logging.cpp bench: document expected results in logging benchmarks 2023-03-07 09:32:55 -08:00
mempool_eviction.cpp
mempool_stress.cpp
merkle_root.cpp
nanobench.cpp
nanobench.h Update nanobench to version v4.3.10 2023-02-03 07:08:28 +01:00
peer_eviction.cpp
poly1305.cpp
prevector.cpp Use DataStream where possible 2023-01-26 10:44:05 +01:00
rollingbloom.cpp
rpc_blockchain.cpp
rpc_mempool.cpp
strencodings.cpp
util_time.cpp
verify_script.cpp
wallet_balance.cpp refactor: wallet, remove global 'ArgsManager' access 2023-02-15 15:49:45 -03:00
wallet_create_tx.cpp gui: bugfix, getAvailableBalance skips selected coins 2023-04-03 17:23:42 -03:00
wallet_loading.cpp Fix clang-tidy readability-const-return-type violations 2023-02-01 11:33:35 +01:00