Merge #21201: rpc: Disallow sendtoaddress and sendmany when private keys disabled
pull/826/head6bfbc97d71
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: ACK6bfbc97d71
meshcollider: utACK6bfbc97d71
kristapsk: ACK6bfbc97d71
. "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
commit
3a2d5bfeb3
Loading…
Reference in new issue