delinvoice was orginally documented to only allow deletion of unpaid
invoices, but there might be reasons to delete paid ones or unexpired ones.
But we have to avoid the race where someone pays as it's deleted: the
easiest way is to have the caller tell us the status, and fail if
it's wrong.
Fixes: #477
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
lightning-delinvoice \- Protocol for removing an unpaid invoice\&.
lightning-delinvoice \- Protocol for removing an invoice\&.
.SH"SYNOPSIS"
.SH"SYNOPSIS"
.sp
.sp
\fBdelinvoice\fR\fIlabel\fR
\fBdelinvoice\fR\fIlabel\fR\fIstatus\fR
.SH"DESCRIPTION"
.SH"DESCRIPTION"
.sp
.sp
The \fBdelinvoice\fR RPC command removes an unpaid invoice\&. The caller should be particularly aware of the error case caused by a payment just before this command is invoked!
The \fBdelinvoice\fR RPC command removes an invoice with \fIstatus\fR as given in \fBlistinvoices\fR\&.
.sp
The caller should be particularly aware of the error case caused by the \fIstatus\fR chaning just before this command is invoked!
.SH"RETURN VALUE"
.SH"RETURN VALUE"
.sp
.sp
On success, an invoice description will be returned as per lightning\-listinvoice(7)\&.
On success, an invoice description will be returned as per lightning\-listinvoice(7)\&.