0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-03-05 14:06:27 -05:00
bitcoin-core/src
Samuel Dobson 3a2d5bfeb3
Merge #21201: rpc: Disallow sendtoaddress and sendmany when private keys disabled
6bfbc97d71 test: disallow sendtoaddress/sendmany when private keys disabled (Jon Atack)
0997019e76 Disallow sendtoaddress and sendmany when private keys disabled (Andrew Chow)

Pull request description:

  Since `sendtoaddress` and `sendmany` (which use the `SendMoney` function) create and commit a transaction, they should not do anything when the wallet does not have private keys. Otherwise a valid transaction cannot be made.

  Fixes #21104

ACKs for top commit:
  jonatack:
    ACK 6bfbc97d71
  meshcollider:
    utACK 6bfbc97d71
  kristapsk:
    ACK 6bfbc97d71. "Error: Private keys are disabled for this wallet" is definitely a better error message than "Insufficient funds" here. Hopefully change of error code from -6 to -4 doesn't break any software using Bitcoin JSON-RPC API.

Tree-SHA512: f277d6b5252e43942d568614032596f2c0827f00cd0cb71e44ffcb9822bfb15a71730a3e3688f31e59ba4eb7d275250c4e65ad4b6b3e96be6314c56a672432fb
2021-02-19 14:00:48 +13:00
..
bench Merge #20429: refactor: replace (sizeof(a)/sizeof(a[0])) with C++17 std::size 2021-02-18 07:53:37 +01:00
compat
config
consensus
crc32c
crypto
index
interfaces
leveldb
logging
node chainparams: add allowed assumeutxo values 2021-02-12 07:53:22 -06:00
policy
primitives
qt Merge #20429: refactor: replace (sizeof(a)/sizeof(a[0])) with C++17 std::size 2021-02-18 07:53:37 +01:00
rpc Merge #19806: validation: UTXO snapshot activation 2021-02-16 19:23:06 +01:00
script Merge #19136: wallet: add parent_desc to getaddressinfo 2021-02-18 21:51:16 +13:00
secp256k1
support
test Merge #19809: log: Prefix log messages with function name and source code location if -logsourcelocations is set 2021-02-18 14:37:51 +01:00
univalue
util Merge #19809: log: Prefix log messages with function name and source code location if -logsourcelocations is set 2021-02-18 14:37:51 +01:00
wallet Merge #21201: rpc: Disallow sendtoaddress and sendmany when private keys disabled 2021-02-19 14:00:48 +13:00
zmq
.clang-format
addrdb.cpp
addrdb.h
addrman.cpp
addrman.h
amount.h
arith_uint256.cpp
arith_uint256.h
attributes.h
banman.cpp
banman.h
base58.cpp
base58.h
bech32.cpp
bech32.h
bitcoin-cli-res.rc
bitcoin-cli.cpp cli: Treat high detail levels as the maximum in -netinfo 2021-02-15 20:01:52 +01:00
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
bloom.cpp
bloom.h
chain.cpp
chain.h simplify ChainstateManager::SnapshotBlockhash() return semantics 2021-02-12 07:53:29 -06:00
chainparams.cpp Merge #15946: Allow maintaining the blockfilterindex when using prune 2021-02-18 09:40:42 +01:00
chainparams.h chainparams: add allowed assumeutxo values 2021-02-12 07:53:22 -06:00
chainparamsbase.cpp
chainparamsbase.h
chainparamsseeds.h
checkqueue.h
clientversion.cpp
clientversion.h
coins.cpp simplify ChainstateManager::SnapshotBlockhash() return semantics 2021-02-12 07:53:29 -06:00
coins.h simplify ChainstateManager::SnapshotBlockhash() return semantics 2021-02-12 07:53:29 -06:00
compat.h
compressor.cpp
compressor.h
core_io.h
core_memusage.h
core_read.cpp
core_write.cpp
cuckoocache.h
dbwrapper.cpp
dbwrapper.h
dummywallet.cpp
flatfile.cpp
flatfile.h
fs.cpp
fs.h
hash.cpp
hash.h
httprpc.cpp
httprpc.h
httpserver.cpp
httpserver.h
indirectmap.h
init.cpp Merge #19809: log: Prefix log messages with function name and source code location if -logsourcelocations is set 2021-02-18 14:37:51 +01:00
init.h
key.cpp
key.h
key_io.cpp
key_io.h
logging.cpp Merge #19809: log: Prefix log messages with function name and source code location if -logsourcelocations is set 2021-02-18 14:37:51 +01:00
logging.h
Makefile.am Merge #20629: depends: Improve id string robustness 2021-02-15 11:43:00 +01:00
Makefile.bench.include
Makefile.crc32c.include
Makefile.leveldb.include
Makefile.qt.include
Makefile.qt_locale.include
Makefile.qttest.include
Makefile.test.include Merge #20788: net: add RAII socket and use it instead of bare SOCKET 2021-02-11 14:07:33 +01:00
Makefile.test_fuzz.include
Makefile.test_util.include
mapport.cpp
mapport.h
memusage.h
merkleblock.cpp
merkleblock.h
miner.cpp
miner.h
net.cpp scripted-diff: rename ping members 2021-02-15 16:15:51 +00:00
net.h scripted-diff: rename ping members 2021-02-15 16:15:51 +00:00
net_permissions.cpp
net_permissions.h
net_processing.cpp Merge #21188: scripted-diff: Remove redundant lock annotations in net processing 2021-02-17 09:53:29 +01:00
net_processing.h [net processing] Move ping data fields to net processing 2021-02-15 16:15:51 +00:00
net_types.h
netaddress.cpp
netaddress.h
netbase.cpp Merge #20965: net, rpc: return NET_UNROUTABLE as not_publicly_routable, automate helps 2021-02-15 15:31:15 +01:00
netbase.h Merge #20965: net, rpc: return NET_UNROUTABLE as not_publicly_routable, automate helps 2021-02-15 15:31:15 +01:00
netmessagemaker.h
noui.cpp
noui.h
optional.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 Merge #20429: refactor: replace (sizeof(a)/sizeof(a[0])) with C++17 std::size 2021-02-18 07:53:37 +01:00
reverse_iterator.h
scheduler.cpp
scheduler.h
serialize.h
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
torcontrol.cpp Merge #20788: net: add RAII socket and use it instead of bare SOCKET 2021-02-11 14:07:33 +01:00
torcontrol.h
txdb.cpp txdb: don't reset during in-memory cache resize 2021-02-12 07:53:32 -06:00
txdb.h
txmempool.cpp
txmempool.h
txrequest.cpp
txrequest.h
uint256.cpp
uint256.h
undo.h
validation.cpp Merge #15946: Allow maintaining the blockfilterindex when using prune 2021-02-18 09:40:42 +01:00
validation.h Merge #15946: Allow maintaining the blockfilterindex when using prune 2021-02-18 09:40:42 +01:00
validationinterface.cpp
validationinterface.h
version.h
versionbits.cpp
versionbits.h
versionbitsinfo.cpp
versionbitsinfo.h
walletinitinterface.h
warnings.cpp
warnings.h