bitcoin/src
MarcoFalke f4e5d704f2
Merge bitcoin/bitcoin#24118: Add 'sendall' RPC née sweep
bb84b7145b add tests for no recipient and using send_max while inputs are specified (ishaanam)
49090ec402 Add sendall RPC née sweep (Murch)
902793c777 Extract FinishTransaction from send() (Murch)
6d2208a3f6 Extract interpretation of fee estimation arguments (Murch)
a31d75e5fb Elaborate error messages for outdated options (Murch)
35ed094e4b Extract prevention of outdated option names (Murch)

Pull request description:

  Add sendall RPC née sweep

  _Motivation_
  Currently, the wallet uses a fSubtractFeeAmount (SFFO) flag on the
  recipients objects for all forms of sending calls. According to the
  commit discussion, this flag was chiefly introduced to permit sweeping
  without manually calculating the fees of transactions. However, the flag
  leads to unintuitive behavior and makes it more complicated to test
  many wallet RPCs exhaustively. We proposed to introduce a dedicated
  `sendall` RPC with the intention to cover this functionality.

  Since the proposal, it was discovered in further discussion that our
  proposed `sendall` rpc and SFFO have subtly different scopes of
  operation.
  • sendall:
    Use _given UTXOs_ to pay a destination the remainder after fees.
  • SFFO:
    Use a _given budget_ to pay an address the remainder after fees.

  While `sendall` will simplify cases of spending a given set of
  UTXOs such as paying the value from one or more specific UTXOs, emptying
  a wallet, or burning dust, we realized that there are some cases in
  which SFFO is used to pay other parties from a limited budget,
  which can often lead to the creation of change outputs. This cannot be
  easily replicated using `sendall` as it would require manual
  computation of the appropriate change amount.

  As such, sendall cannot replace all uses of SFFO, but it still has a
  different use case and will aid in simplifying some wallet calls and
  numerous wallet tests.

  _Sendall call details_
  The proposed sendall call builds a transaction from a specific
  subset of the wallet's UTXO pool (by default all of them) and assigns
  the funds to one or more receivers. Receivers can either be specified
  with a given amount or receive an equal share of the remaining
  unassigned funds. At least one recipient must be provided without
  assigned amount to collect the remainder. The `sendall` call will
  never create change. The call has a `send_max` option that changes the
  default behavior of spending all UTXOs ("no UTXO left behind"), to
  maximizing the output amount of the transaction by skipping uneconomic
  UTXOs. The `send_max` option is incompatible with providing a specific
  set of inputs.

  ---
  Edit: Replaced OP with latest commit message to reflect my updated motivation of the proposal.

ACKs for top commit:
  achow101:
    re-ACK bb84b7145b

Tree-SHA512: 20aaf75d268cb4b144f5d6437d33ec7b5f989256b3daeeb768ae1e7f39dc6b962af8223c5cb42ecc72dc38cecd921c53c077bc0ec300b994e902412213dd2cc3
2022-03-30 15:02:49 +02:00
..
bench bench: fix incorrect named args in coin_selection bench 2022-03-25 21:27:39 +00:00
common refactor: Fixup uint64_t-cast style in touched line 2022-02-01 11:19:18 +01:00
compat compat: remove strnlen back-compat code 2022-03-29 10:15:33 +01:00
config
consensus Merge bitcoin/bitcoin#23536: Enforce Taproot script flags whenever WITNESS is set 2022-03-25 14:11:18 +01:00
crc32c Update crc32c subtree 2021-09-29 14:10:29 +02:00
crypto doc: Fix typos 2022-02-17 03:42:08 +09:00
index refactor: more const annotations for uses of CBlockIndex* 2022-03-09 14:32:47 -05:00
init Use GetPathArg where possible 2022-03-02 12:09:27 +01:00
interfaces Merge bitcoin/bitcoin#22834: net: respect -onlynet= when making outbound connections 2022-03-01 18:32:01 +01:00
ipc refactor: Block unsafe fs::path std::string conversion calls 2021-10-05 11:10:47 -04:00
leveldb build: Minor leveldb subtree update 2022-03-02 15:25:48 +01:00
logging scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
minisketch Update minisketch subtree to latest upstream 2022-02-04 22:47:49 +08:00
node Use CAmount for fee delta and modified fee 2022-03-21 13:38:08 +01:00
policy Remove outdated comment on CFeeRate 2022-02-14 16:01:26 -05:00
primitives Merge bitcoin/bitcoin#24350: Primitives: Correct CTransaction deserialization docstring 2022-02-19 09:35:10 +01:00
qt Merge bitcoin/bitcoin#24494: wallet: generate random change target for each tx for better privacy 2022-03-25 21:03:32 +00:00
rpc Merge bitcoin/bitcoin#24118: Add 'sendall' RPC née sweep 2022-03-30 15:02:49 +02:00
script Merge bitcoin/bitcoin#24462: For descriptor pubkey parse errors, include context information 2022-03-23 09:38:54 +01:00
secp256k1 Update secp256k1 subtree to latest upstream master 2021-12-15 09:19:50 -05:00
support Use spans of std::byte in serialize 2022-01-02 11:40:31 +01:00
test Merge bitcoin/bitcoin#24692: refactoring: [Net Processing] Follow-ups to #21160 2022-03-30 07:13:52 +01:00
univalue Update univalue subtree to latest upstream 2021-10-11 20:45:56 +08:00
util Merge bitcoin/bitcoin#24690: util: Add inotify_rm_watch to syscall sandbox (AllowFileSystem) 2022-03-30 10:19:25 +01:00
wallet Merge bitcoin/bitcoin#24118: Add 'sendall' RPC née sweep 2022-03-30 15:02:49 +02:00
zmq zmq: Fix implicit-integer-sign-change 2022-01-31 16:53:12 +01:00
.clang-format Use c++17 in clang-format 2021-11-12 11:46:34 +01:00
.clang-tidy Enable clang-tidy bugprone-argument-comment and fix violations 2021-09-07 09:11:10 +02:00
addrdb.cpp Merge bitcoin/bitcoin#24201: p2p: Avoid InitError when downgrading peers.dat 2022-02-25 08:45:11 +01:00
addrdb.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
addrman.cpp addrman: fix incorrect named args 2022-03-25 08:22:24 +00:00
addrman.h p2p: Avoid InitError when downgrading peers.dat 2022-02-25 09:53:10 +09:00
addrman_impl.h test: Remove unused AddrManTest class 2021-12-28 21:54:51 +01:00
arith_uint256.cpp Fix implicit-integer-sign-change in arith_uint256 2022-01-13 15:56:59 +01:00
arith_uint256.h
attributes.h
banman.cpp Fix race condition for SetBannedSetDirty() calls 2022-01-28 19:27:25 +00:00
banman.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
base58.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
base58.h
bech32.cpp Avoid implicit-integer-sign-change in bech32.cpp 2022-02-25 09:43:54 +01:00
bech32.h Make Bech32 LocateErrors return error list rather than using out-arg 2021-12-06 14:17:41 +13:00
bitcoin-chainstate.cpp bitcoin-chainstate: Lock cs_main to UnloadBlockIndex 2022-03-08 16:12:03 -05:00
bitcoin-cli-res.rc windres: use PACKAGE_VERSION rather than building more version numbers 2021-08-17 16:54:47 +08:00
bitcoin-cli.cpp Output license info when binaries are passed -version 2022-02-22 15:36:19 +00:00
bitcoin-tx-res.rc windres: use PACKAGE_VERSION rather than building more version numbers 2021-08-17 16:54:47 +08:00
bitcoin-tx.cpp Output license info when binaries are passed -version 2022-02-22 15:36:19 +00:00
bitcoin-util-res.rc windres: use PACKAGE_VERSION rather than building more version numbers 2021-08-17 16:54:47 +08:00
bitcoin-util.cpp refactor: remove unused boost header include in bitcoin-util.cpp 2022-03-25 15:30:20 +00:00
bitcoin-wallet-res.rc windres: use PACKAGE_VERSION rather than building more version numbers 2021-08-17 16:54:47 +08:00
bitcoin-wallet.cpp Output license info when binaries are passed -version 2022-02-22 15:36:19 +00:00
bitcoind-res.rc windres: use PACKAGE_VERSION rather than building more version numbers 2021-08-17 16:54:47 +08:00
bitcoind.cpp Output license info when binaries are passed -version 2022-02-22 15:36:19 +00:00
blockencodings.cpp
blockencodings.h
blockfilter.cpp scripted-diff: rename MapIntoRange to FastRange64 2022-01-06 11:29:55 -05:00
blockfilter.h
chain.cpp Avoid integer sanitizer warnings in chain.o 2022-01-25 10:49:46 +01:00
chain.h Merge bitcoin/bitcoin#24146: Avoid integer sanitizer warnings in chain.o 2022-01-31 09:23:54 +01:00
chainparams.cpp Merge bitcoin/bitcoin#23536: Enforce Taproot script flags whenever WITNESS is set 2022-03-25 14:11:18 +01:00
chainparams.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
chainparamsbase.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
chainparamsbase.h
chainparamsseeds.h net: Update hardcoded seeds for 23.x 2022-02-22 15:15:27 +01:00
checkqueue.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
clientversion.cpp refactor: shift CopyrightHolders() and LicenseInfo() to clientversion.cpp 2022-02-22 15:36:19 +00:00
clientversion.h refactor: shift CopyrightHolders() and LicenseInfo() to clientversion.cpp 2022-02-22 15:36:19 +00:00
coins.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
coins.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
compat.h compat: remove strnlen back-compat code 2022-03-29 10:15:33 +01:00
compressor.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
compressor.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
core_io.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
core_memusage.h
core_read.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
core_write.cpp rpc: Exclude descriptor when address is excluded 2022-03-23 11:09:34 +01:00
cuckoocache.h Add FastRange32 function and use it throughout the codebase 2022-01-07 13:37:47 -05:00
dbwrapper.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
dbwrapper.h Use spans of std::byte in serialize 2022-01-02 11:40:31 +01:00
deploymentinfo.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
deploymentinfo.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
deploymentstatus.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
deploymentstatus.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
dummywallet.cpp Add src/wallet/* code to wallet:: namespace 2022-01-06 22:14:16 -05:00
external_signer.cpp external_signer: improve fingerprint matching logic (stop on first match) 2021-08-24 11:30:09 +02:00
external_signer.h refactor: make ExternalSigner NetworkArg() and m_chain private 2021-06-16 10:48:58 +02:00
flatfile.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
flatfile.h
fs.cpp refactor: replace boost::filesystem with std::filesystem 2022-02-03 18:35:52 +08:00
fs.h Make fs.h C++20 compliant 2022-03-24 11:36:37 +01:00
hash.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
hash.h Use spans of std::byte in serialize 2022-01-02 11:40:31 +01:00
httprpc.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
httprpc.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
httpserver.cpp Merge bitcoin/bitcoin#23607: rpc: Pass const char* to evhttp_connection_get_peer for new libevent 2022-01-13 18:35:25 +01:00
httpserver.h
i2p.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
i2p.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
indirectmap.h
init.cpp init: add missing cs_main lock 2022-03-26 00:04:07 +10:00
init.h refactor: shift CopyrightHolders() and LicenseInfo() to clientversion.cpp 2022-02-22 15:36:19 +00:00
key.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
key.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
key_io.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
key_io.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
logging.cpp refactor: replace boost::filesystem with std::filesystem 2022-02-03 18:35:52 +08:00
logging.h refactor: replace boost::filesystem with std::filesystem 2022-02-03 18:35:52 +08:00
Makefile.am compat: remove strnlen back-compat code 2022-03-29 10:15:33 +01:00
Makefile.bench.include Merge bitcoin/bitcoin#18815: bench: Add logging benchmark 2022-03-16 16:56:29 +01:00
Makefile.crc32c.include build: remove support for weak linking getauxval() 2021-09-24 15:40:04 +08:00
Makefile.leveldb.include build: remove build stubs for external leveldb 2021-10-15 01:02:45 +00:00
Makefile.minisketch.include build: add minisketch build file and include it 2021-10-21 09:37:30 +08:00
Makefile.qt.include build: header-only Boost 2022-02-13 20:59:07 +00:00
Makefile.qt_locale.include qt: Pre-branch translation updates for 23.x 2022-02-28 16:59:56 +01:00
Makefile.qttest.include test: Add tests for GetArg methods / settings.json type coercion 2022-03-07 13:29:46 -05:00
Makefile.test.include Merge bitcoin/bitcoin#19385: test: Change default test logging directory 2022-03-25 13:30:26 +01:00
Makefile.test_fuzz.include scripted-diff: Rename libbitcoin_server.a to libbitcoin_node.a 2021-12-20 10:53:01 -05:00
Makefile.test_util.include scripted-diff: Rename libbitcoin_server.a to libbitcoin_node.a 2021-12-20 10:53:01 -05:00
Makefile.univalue.include Integrate univalue into our buildsystem 2021-10-11 20:46:25 +08:00
mapport.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
mapport.h
memusage.h
merkleblock.cpp
merkleblock.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
net.cpp scripted-diff: rename TxRelay members 2022-03-18 11:35:58 +00:00
net.h Merge bitcoin/bitcoin#21160: net/net processing: Move tx inventory into net_processing 2022-03-25 15:16:00 +00:00
net_permissions.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
net_permissions.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
net_processing.cpp [net processing] PushNodeVersion() takes a const Peer& 2022-03-29 15:54:16 +01:00
net_processing.h scripted-diff: rename TxRelay members 2022-03-18 11:35:58 +00:00
net_types.cpp net: Drop only invalid entries when reading banlist.json 2021-12-14 18:58:45 +01:00
net_types.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
netaddress.cpp net: remove unused CNetAddr::GetHash() 2022-02-11 15:21:52 +01:00
netaddress.h net: remove unused CNetAddr::GetHash() 2022-02-11 15:21:52 +01:00
netbase.cpp Merge bitcoin/bitcoin#23542: net: open p2p connections to nodes that listen on non-default ports 2022-03-02 09:33:03 +01:00
netbase.h Merge bitcoin/bitcoin#23542: net: open p2p connections to nodes that listen on non-default ports 2022-03-02 09:33:03 +01:00
netmessagemaker.h
noui.cpp
noui.h
outputtype.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
outputtype.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
pow.cpp
pow.h
prevector.h
protocol.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
protocol.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
psbt.cpp Use spans of std::byte in serialize 2022-01-02 11:40:31 +01:00
psbt.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
pubkey.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
pubkey.h Use spans of std::byte in serialize 2022-01-02 11:40:31 +01:00
random.cpp build: remove unneeded getentropy detection (HAVE_GETENTROPY) 2022-02-02 17:22:42 +01:00
random.h doc: Fix typos pointed out by lint-spelling 2022-01-30 08:59:10 -03:00
randomenv.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
randomenv.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
rest.cpp Merge bitcoin/bitcoin#24515: Only load BlockMan in BlockMan member functions 2022-03-17 07:23:43 +01:00
reverse_iterator.h
scheduler.cpp scheduler: Capture ‘this’ explicitly in lambda 2022-03-24 11:36:37 +01:00
scheduler.h refactor: replace RecursiveMutex m_callbacks_mutex with Mutex 2022-01-14 13:27:41 +01:00
serialize.h Remove unused char serialize 2022-01-02 11:52:11 +01:00
shutdown.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
shutdown.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
signet.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
signet.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
span.h span: Add BytePtr helper 2022-01-02 11:13:40 +01:00
streams.h scripted-diff: Rename nReadPos to m_read_pos in streams.h 2022-02-09 17:21:04 +01:00
sync.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
sync.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
threadinterrupt.cpp
threadinterrupt.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
threadsafety.h
timedata.cpp timedata: rename variables to match the coding style 2022-03-02 15:40:35 +01:00
timedata.h timedata: make it possible to reset the state 2022-03-02 15:40:30 +01:00
tinyformat.h Use C++17 [[fallthrough]] attribute, and drop -Wno-implicit-fallthrough 2021-07-05 08:59:38 +03:00
torcontrol.cpp torcontrol: Query Tor for correct -onion configuration 2022-03-15 01:33:52 +00:00
torcontrol.h torcontrol: Query Tor for correct -onion configuration 2022-03-15 01:33:52 +00:00
txdb.cpp Replace "can not" with "cannot" in docs, user messages, and tests 2022-02-21 19:07:29 +01:00
txdb.h Replace lock with thread safety annotation in CBlockTreeDB::LoadBlockIndexGuts() 2022-01-28 20:52:53 +01:00
txmempool.cpp Use CAmount for fee delta and modified fee 2022-03-21 13:38:08 +01:00
txmempool.h Use CAmount for fee delta and modified fee 2022-03-21 13:38:08 +01:00
txorphanage.cpp
txorphanage.h [net processing] Add Orphanage empty consistency check 2021-07-20 13:12:42 +01:00
txrequest.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
txrequest.h
uint256.cpp
uint256.h Use spans of std::byte in serialize 2022-01-02 11:40:31 +01:00
undo.h
validation.cpp Merge bitcoin/bitcoin#23536: Enforce Taproot script flags whenever WITNESS is set 2022-03-25 14:11:18 +01:00
validation.h Merge bitcoin/bitcoin#24515: Only load BlockMan in BlockMan member functions 2022-03-17 07:23:43 +01:00
validationinterface.cpp
validationinterface.h Add coinstatsindex_unclean_shutdown test 2022-02-25 16:06:27 -05:00
version.h
versionbits.cpp trivial: comment tweaks 2022-01-28 18:07:08 +10:00
versionbits.h Merge bitcoin/bitcoin#23508: Add getdeploymentinfo RPC 2022-01-28 08:46:03 +01:00
walletinitinterface.h Add src/node/* code to node:: namespace 2022-01-06 22:14:16 -05:00
warnings.cpp
warnings.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00