bitcoin/src
fanquake 820129aee9
Merge bitcoin/bitcoin#22686: wallet: Use GetSelectionAmount in ApproximateBestSubset
92885c4f69 test: Test for ApproximateBestSubset edge case with too little fees (Andrew Chow)
d9262324e8 wallet: Assert that enough was selected to cover the fees (Andrew Chow)
2de222c401 wallet: Use GetSelectionAmount for target value calculations (Andrew Chow)

Pull request description:

  The `m_value` used for the target calculation in `ApproximateBestSubset` is incorrect, it should be `GetSelectionAmount`. This causes a bug that is only apparent when the minimum relay fee is set to be very high.

  A test case is added for this, in addition to an assert in `CreateTransactionInternal` that would have also caught this issue if someone were able to hit the edge case.

  Fixes #22670

ACKs for top commit:
  instagibbs:
    utACK 92885c4f69

Tree-SHA512: bd61fa61ffb60873e097737eebea3afe8a42296ba429de9038b3a4706763b34de9409de6cdbab21ff7f51f4787b503f840873182d9c4a1d6e12a54b017953547
2021-08-16 11:23:53 +08:00
..
bench [addrman] Make addrman consistency checks a runtime option 2021-08-12 10:41:11 +01:00
compat Remove support for double serialization 2021-05-24 16:15:05 -07:00
config
consensus consensus/params: simplify ValidDeployment check to avoid gcc warning 2021-08-02 23:48:32 +10:00
crc32c
crypto
index Merge bitcoin/bitcoin#22047: index, rpc: Coinstatsindex follow-ups 2021-07-28 15:19:34 +02:00
init Make SetupServerArgs callable without NodeContext 2021-06-10 09:58:45 -05:00
interfaces Merge bitcoin/bitcoin#22218: multiprocess: Add ipc::Context and ipc::capnp::Context structs 2021-07-22 08:26:30 +02:00
ipc Add ipc::Context and ipc::capnp::Context structs 2021-06-10 09:58:45 -05:00
leveldb
logging
node [GetTransaction] remove unneeded cs_main lock acquire 2021-08-02 18:31:02 +02:00
policy MOVEONLY: context-free package policies 2021-06-02 17:26:44 +01:00
primitives
qt Merge bitcoin-core/gui#360: Unregister wallet notifications before unloading wallets 2021-08-12 20:03:00 +03:00
rpc Merge bitcoin/bitcoin#22541: Add a new RPC command: restorewallet 2021-08-15 16:58:05 +12:00
script Merge bitcoin/bitcoin#22337: wallet: Use bilingual_str for errors 2021-08-09 14:45:12 +12:00
secp256k1 Update secp256k1 subtree to latest upstream + adapt API 2021-07-14 14:43:45 -07:00
support
test Merge bitcoin/bitcoin#20233: addrman: Make consistency checks a runtime option 2021-08-13 17:03:01 +08:00
univalue
util Merge bitcoin/bitcoin#22653: refactor: Rename JoinErrors and re-use it 2021-08-11 09:56:34 +08:00
wallet Merge bitcoin/bitcoin#22686: wallet: Use GetSelectionAmount in ApproximateBestSubset 2021-08-16 11:23:53 +08:00
zmq zmq: use msg: prefix over errno= in zmqError 2021-06-09 19:25:13 +08:00
.clang-format
addrdb.cpp Ignore banlist.dat 2021-07-30 11:21:51 +02:00
addrdb.h Ignore banlist.dat 2021-07-30 11:21:51 +02:00
addrman.cpp p2p: log addrman consistency checks 2021-08-13 13:16:55 +02:00
addrman.h [addrman] Make addrman consistency checks a runtime option 2021-08-12 10:41:11 +01:00
amount.h
arith_uint256.cpp
arith_uint256.h
attributes.h
banman.cpp Ignore banlist.dat 2021-07-30 11:21:51 +02:00
banman.h Ignore banlist.dat 2021-07-30 11:21:51 +02:00
base58.cpp
base58.h
bech32.cpp
bech32.h
bitcoin-cli-res.rc
bitcoin-cli.cpp cli: Add progress bar for -getinfo 2021-08-03 00:58:12 +08:00
bitcoin-tx-res.rc
bitcoin-tx.cpp Add support for SIGHASH_DEFAULT in RPCs, and make it default 2021-06-12 12:38:17 -07:00
bitcoin-util-res.rc
bitcoin-util.cpp refactor: Pass grind args vector as const reference 2021-06-18 20:10:07 +02:00
bitcoin-wallet-res.rc
bitcoin-wallet.cpp Remove unused OptionsCategory arg from AddCommand 2021-06-18 20:09:23 +02:00
bitcoind-res.rc
bitcoind.cpp Make SetupServerArgs callable without NodeContext 2021-06-10 09:58:45 -05:00
blockencodings.cpp
blockencodings.h
blockfilter.cpp
blockfilter.h
bloom.cpp
bloom.h
chain.cpp
chain.h doc: Various validation doc fixups 2021-06-03 13:53:31 +02:00
chainparams.cpp test: Set regtest.BIP66Height = 102 to speed up tests 2021-08-05 12:08:33 +02:00
chainparams.h net: distinguish default port per network 2021-07-09 11:19:36 +02:00
chainparamsbase.cpp [p2p] remove unused segwitheight=-1 option 2021-07-07 22:13:01 -07:00
chainparamsbase.h
chainparamsseeds.h contrib, p2p: update I2P hardcoded seeds 2021-07-30 11:03:44 +02:00
checkqueue.h
clientversion.cpp
clientversion.h
coins.cpp refactor: wrap CCoinsViewCursor in unique_ptr 2021-06-17 09:47:08 -04:00
coins.h refactor: wrap CCoinsViewCursor in unique_ptr 2021-06-17 09:47:08 -04:00
compat.h
compressor.cpp
compressor.h
core_io.h
core_memusage.h
core_read.cpp Add support for SIGHASH_DEFAULT in RPCs, and make it default 2021-06-12 12:38:17 -07:00
core_write.cpp
cuckoocache.h
dbwrapper.cpp
dbwrapper.h
deploymentinfo.cpp deploymentinfo: Add DeploymentName() 2021-06-30 08:19:12 +10:00
deploymentinfo.h deploymentinfo: Add DeploymentName() 2021-06-30 08:19:12 +10:00
deploymentstatus.cpp consensus/params: simplify ValidDeployment check to avoid gcc warning 2021-08-02 23:48:32 +10:00
deploymentstatus.h Use DeploymentEnabled to hide VB deployments 2021-07-01 20:20:52 +02:00
dummywallet.cpp
external_signer.cpp refactor: make ExternalSigner NetworkArg() and m_chain private 2021-06-16 10:48:58 +02:00
external_signer.h refactor: make ExternalSigner NetworkArg() and m_chain private 2021-06-16 10:48:58 +02:00
flatfile.cpp
flatfile.h
fs.cpp
fs.h
hash.cpp Use C++17 [[fallthrough]] attribute, and drop -Wno-implicit-fallthrough 2021-07-05 08:59:38 +03:00
hash.h
httprpc.cpp
httprpc.h
httpserver.cpp refactor: Make httpserver work queue a unique_ptr 2021-06-28 11:47:05 +02:00
httpserver.h
i2p.cpp net: do not connect to I2P hosts on port!=0 2021-07-09 11:19:37 +02:00
i2p.h
indirectmap.h
init.cpp [addrman] Make addrman consistency checks a runtime option 2021-08-12 10:41:11 +01:00
init.h init: remove straggling boost thread_group code 2021-07-12 21:46:59 +08:00
key_io.cpp Separate WitnessV1Taproot variant in CTxDestination 2021-05-24 12:14:16 -07:00
key_io.h
key.cpp Update secp256k1 subtree to latest upstream + adapt API 2021-07-14 14:43:45 -07:00
key.h Add CKey::SignSchnorr function for BIP 340/341 signing 2021-06-12 12:25:28 -07:00
logging.cpp log, refactor: use guard clause in LogCategoriesList() 2021-07-22 23:09:52 +02:00
logging.h log: sort LogCategoriesList and LogCategoriesString alphabetically 2021-07-22 23:09:42 +02:00
Makefile.am Merge bitcoin/bitcoin#22218: multiprocess: Add ipc::Context and ipc::capnp::Context structs 2021-07-22 08:26:30 +02:00
Makefile.bench.include bench: add peer eviction protection benchmarks 2021-07-08 12:28:23 +02:00
Makefile.crc32c.include
Makefile.leveldb.include Use C++17 [[fallthrough]] attribute, and drop -Wno-implicit-fallthrough 2021-07-05 08:59:38 +03:00
Makefile.qt_locale.include
Makefile.qt.include qt, refactor: Move InitExecutor class into its own module 2021-07-14 21:54:32 +03:00
Makefile.qttest.include
Makefile.test_fuzz.include
Makefile.test_util.include
Makefile.test.include Merge bitcoin/bitcoin#21882: build: Fix undefined reference to __mulodi4 2021-07-29 20:53:36 +08:00
mapport.cpp
mapport.h
memusage.h
merkleblock.cpp
merkleblock.h
miner.cpp [refactor] Move ComputeBlockVersion into VersionBitsCache 2021-06-30 08:19:12 +10:00
miner.h miner: Pass in chainman to RegenerateCommitments 2021-05-27 13:50:11 -04:00
net_permissions.cpp p2p: pass strings to NetPermissions::TryParse functions by const ref 2021-05-19 19:41:05 +02:00
net_permissions.h Rate limit the processing of incoming addr messages 2021-07-15 12:52:38 -07:00
net_processing.cpp Merge bitcoin/bitcoin#22604: p2p, rpc, test: address rate-limiting follow-ups 2021-08-14 13:33:47 +08:00
net_processing.h Merge bitcoin/bitcoin#22577: Close minor startup race between main and scheduler threads 2021-08-04 16:37:12 +02:00
net_types.h
net.cpp tracing: Tracepoints for in- and outbound P2P msgs 2021-07-27 17:12:16 +02:00
net.h Merge bitcoin/bitcoin#22098: [test, init] DNS seed querying logic 2021-08-03 11:21:15 +08:00
netaddress.cpp Merge bitcoin/bitcoin#22179: Torv2 removal followups 2021-07-08 17:20:35 +02:00
netaddress.h Fix whitespace in touched files 2021-07-30 11:24:59 +02:00
netbase.cpp
netbase.h
netmessagemaker.h
noui.cpp
noui.h
outputtype.cpp make ParseOutputType return a std::optional<OutputType> 2021-08-04 19:20:32 +08:00
outputtype.h make ParseOutputType return a std::optional<OutputType> 2021-08-04 19:20:32 +08:00
pow.cpp
pow.h
prevector.h
protocol.cpp
protocol.h Add roundtrip fuzz tests for CAddress serialization 2021-05-24 18:06:35 -07:00
psbt.cpp Make GetInputUTXO safer: verify non-witness UTXO match 2021-06-12 12:25:28 -07:00
psbt.h Construct and use PrecomputedTransactionData in PSBT signing 2021-06-12 12:25:28 -07:00
pubkey.cpp Update secp256k1 subtree to latest upstream + adapt API 2021-07-14 14:43:45 -07:00
pubkey.h Add CKey::SignSchnorr function for BIP 340/341 signing 2021-06-12 12:25:28 -07:00
random.cpp
random.h
randomenv.cpp
randomenv.h
rest.cpp Use C++17 [[fallthrough]] attribute, and drop -Wno-implicit-fallthrough 2021-07-05 08:59:38 +03:00
reverse_iterator.h
scheduler.cpp
scheduler.h
serialize.h refactor: Switch serialize to uint8_t (1/n) 2021-05-31 14:56:17 +02:00
shutdown.cpp
shutdown.h
signet.cpp
signet.h
span.h
streams.h
sync.cpp
sync.h
threadinterrupt.cpp
threadinterrupt.h
threadsafety.h
timedata.cpp
timedata.h
tinyformat.h Use C++17 [[fallthrough]] attribute, and drop -Wno-implicit-fallthrough 2021-07-05 08:59:38 +03:00
torcontrol.cpp torcontrol: Resolve Tor control plane address 2021-06-27 19:27:25 +02:00
torcontrol.h
txdb.cpp doc: add comment about CCoinsViewDBCursor constructor 2021-06-18 14:15:39 -04:00
txdb.h move-only(ish): don't expose CCoinsViewDBCursor 2021-06-18 14:14:15 -04:00
txmempool.cpp [mempool] check ancestor/descendant limits for packages 2021-08-05 12:37:28 +01:00
txmempool.h [mempool] check ancestor/descendant limits for packages 2021-08-05 12:37:28 +01:00
txorphanage.cpp
txorphanage.h [net processing] Add Orphanage empty consistency check 2021-07-20 13:12:42 +01:00
txrequest.cpp
txrequest.h
uint256.cpp
uint256.h Make XOnlyPubKey act like byte container 2021-05-24 12:14:16 -07:00
undo.h
validation.cpp [policy] ancestor/descendant limits for packages 2021-08-06 10:04:59 +01:00
validation.h misc package validation doc improvements 2021-08-05 12:37:28 +01:00
validationinterface.cpp
validationinterface.h
version.h
versionbits.cpp [refactor] Move ComputeBlockVersion into VersionBitsCache 2021-06-30 08:19:12 +10:00
versionbits.h [refactor] Move ComputeBlockVersion into VersionBitsCache 2021-06-30 08:19:12 +10:00
walletinitinterface.h
warnings.cpp
warnings.h