From 54ec7ae895491ce9047e6589cc7d76bd8b44c226 Mon Sep 17 00:00:00 2001 From: Bitflash Date: Mon, 3 Aug 2026 10:49:25 -0300 Subject: 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=,-5 "Not a valid amount", exit 1 -sendto=,999 refused on an empty wallet, exit 1 All five self-tests still pass. --- src/walletcmd.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/walletcmd.h') 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); // by the installed recovery phrase or still depends on wallet.dat-only keys. int CmdRecoveryAudit(); +// Spend, from the command line. Until now the only way to send was the window, +// so a headless node could be paid and could never pay -- it could hold a +// balance it had no way to move. strArg is "ADDRESS,AMOUNT". +int CmdSendTo(const std::string& strArg); + #endif -- cgit v1.2.3