wallet: clarify error 302.

"Dust limit unmet" seems undescriptive to me.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2018-06-17 14:18:12 +09:30 committed by Christian Decker
parent f4eda74789
commit 7f508cca5f
4 changed files with 8 additions and 7 deletions

View file

@ -20,8 +20,9 @@ static bool check_amount(const struct wallet_tx *tx)
return false;
}
if (tx->amount < 546) {
command_fail(tx->cmd, FUND_DUST_LIMIT_UNMET,
"Dust limit unmet");
command_fail(tx->cmd, FUND_OUTPUT_IS_DUST,
"Output %"PRIu64" satoshis would be dust",
tx->amount);
return false;
}
return true;

View file

@ -2,12 +2,12 @@
.\" Title: lightning-fundchannel
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 06/15/2018
.\" Date: 06/17/2018
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
.TH "LIGHTNING\-FUNDCHANN" "7" "06/15/2018" "\ \&" "\ \&"
.TH "LIGHTNING\-FUNDCHANN" "7" "06/17/2018" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@ -86,7 +86,7 @@ The following error codes may occur:
.sp -1
.IP \(bu 2.3
.\}
302\&. The dust limit is not met\&.
302\&. The output amount is too small, and would be considered dust\&.
.RE
.sp
Failure may also occur if \fBlightningd\fR and the peer cannot agree on channel parameters (funding limits, channel reserves, fees, etc\&.)\&.

View file

@ -39,7 +39,7 @@ The following error codes may occur:
* 300. The maximum allowed funding amount is exceeded.
* 301. There are not enough funds in the internal wallet (including fees) to
create the transaction.
* 302. The dust limit is not met.
* 302. The output amount is too small, and would be considered dust.
Failure may also occur if *lightningd* and the peer cannot agree on channel
parameters (funding limits, channel reserves, fees, etc.).

View file

@ -32,7 +32,7 @@
/* `fundchannel` or `withdraw` errors */
#define FUND_MAX_EXCEEDED 300
#define FUND_CANNOT_AFFORD 301
#define FUND_DUST_LIMIT_UNMET 302
#define FUND_OUTPUT_IS_DUST 302
/* Errors from `invoice` command */
#define INVOICE_LABEL_ALREADY_EXISTS 900