mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-23 15:04:19 +01:00
withdraw: fix incorrect error when we have an empty wallet.
This also highlights the danger of searching the logs: that error appeared previously in the logs, so we didn't notice that the actual withdraw call gave a different error. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -14,7 +14,7 @@ void wtx_init(struct command *cmd, struct wallet_tx * wtx)
|
||||
|
||||
static bool check_amount(const struct wallet_tx *tx, u64 amount)
|
||||
{
|
||||
if (!tx->utxos) {
|
||||
if (tal_count(tx->utxos) == 0) {
|
||||
command_fail(tx->cmd, FUND_CANNOT_AFFORD,
|
||||
"Cannot afford transaction");
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user