diff options
| author | Bitflash <btf01@proton.me> | 2026-08-03 10:49:25 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-03 10:49:25 -0300 |
| commit | 54ec7ae895491ce9047e6589cc7d76bd8b44c226 (patch) | |
| tree | d5f4d4114a1b990089b8c63937c731fadf865af7 /src/walletcmd.h | |
| parent | 57441faffb02f4f2eea37d31b29728de25f18bef (diff) | |
wallet: wire -sendto into main(), where it never was (#119)
CmdSendTo() has been in walletcmd.cpp since #115 and nothing declared
it or called it. The flag was dead: `bitflash -sendto=ADDRESS,AMOUNT`
started a node and said nothing, because an unrecognised argument is
not an error here.
The v1.2.14 notes announce it under "A headless node can finally
spend", and the headless Linux binary is exactly the one that does not
have it -- `-help` there lists /newaddress and stops. The published
Windows binary does have it, because it was built from a working tree
that carried these two files uncommitted. So the artifacts disagree
with each other and neither matches the tag.
This adds only what was missing: the declaration in walletcmd.h, the
dispatch in main(), and the -help line. No behaviour change to
CmdSendTo itself.
Checked on a build of this branch, against a throwaway data directory:
-help lists /sendto=ADDRESS,AMOUNT
-sendto=NOTANADDRESS,1 "Not a valid address", exit 1
-sendto=<valid>,-5 "Not a valid amount", exit 1
-sendto=<valid>,999 refused on an empty wallet, exit 1
All five self-tests still pass.
Diffstat (limited to 'src/walletcmd.h')
| -rw-r--r-- | src/walletcmd.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/walletcmd.h b/src/walletcmd.h index 796356b..69874e4 100644 --- a/src/walletcmd.h +++ b/src/walletcmd.h | |||
| @@ -44,4 +44,9 @@ int CmdShowDerived(int nCount); | |||
| 44 | // by the installed recovery phrase or still depends on wallet.dat-only keys. | 44 | // by the installed recovery phrase or still depends on wallet.dat-only keys. |
| 45 | int CmdRecoveryAudit(); | 45 | int CmdRecoveryAudit(); |
| 46 | 46 | ||
| 47 | // Spend, from the command line. Until now the only way to send was the window, | ||
| 48 | // so a headless node could be paid and could never pay -- it could hold a | ||
| 49 | // balance it had no way to move. strArg is "ADDRESS,AMOUNT". | ||
| 50 | int CmdSendTo(const std::string& strArg); | ||
| 51 | |||
| 47 | #endif | 52 | #endif |