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 Add deserialize + CheckBlock benchmarks, and a full block hex 2016-11-09 11:27:59 -08:00
.gitignore Ignore bench_bitcoin binary. 2015-10-06 17:46:12 +02:00
addrman.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
base58.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
bech32.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
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 Merge bitcoin/bitcoin#26695: bench: BlockAssembler on a mempool with packages 2023-01-11 18:11:11 -05:00
ccoins_caching.cpp Merge bitcoin/bitcoin#26691: Update secp256k1 subtree to libsecp256k1 version 0.2.0 2023-01-13 09:40:57 +00:00
chacha20.cpp Only support 32-byte keys in ChaCha20{,Aligned} 2023-01-30 18:12:21 -05:00
chacha_poly_aead.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
checkblock.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
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 scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
data.h bench: Move generated data to a dedicated translation unit 2019-07-02 18:11:15 +01:00
descriptors.cpp Merge bitcoin/bitcoin#26691: Update secp256k1 subtree to libsecp256k1 version 0.2.0 2023-01-13 09:40:57 +00:00
duplicate_inputs.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
examples.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
gcs_filter.cpp Fix clang-tidy readability-const-return-type violations 2023-02-01 11:33:35 +01:00
hashpadding.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
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 scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
mempool_stress.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
merkle_root.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
nanobench.cpp Replace current benchmarking framework with nanobench 2020-06-13 12:24:18 +02:00
nanobench.h Update nanobench to version v4.3.10 2023-02-03 07:08:28 +01:00
peer_eviction.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
poly1305.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
prevector.cpp Use DataStream where possible 2023-01-26 10:44:05 +01:00
rollingbloom.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
rpc_blockchain.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
rpc_mempool.cpp refactor: add kernel/cs_main.* 2023-01-05 09:05:14 +00:00
strencodings.cpp bench: explicitly make all current benchmarks "high" priority 2022-10-20 10:21:04 -03:00
util_time.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
verify_script.cpp Merge bitcoin/bitcoin#26691: Update secp256k1 subtree to libsecp256k1 version 0.2.0 2023-01-13 09:40:57 +00:00
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