disableoffer: fix disabling of already-used offers.

Turns out we didn't actually test this at all, and next commit does :(

    offer_status_in_db: 4 is invalid
    lightningd: FATAL SIGNAL 6 (version v0.10.0-459-g48fbd45-modded)
    0x5608cd360855 send_backtrace
	common/daemon.c:39
    0x5608cd3608ff crashdump
	common/daemon.c:52
    0x7f9af1dae20f ???
	???:0
    0x7f9af1dae18b ???
	???:0
    0x7f9af1d8d858 ???
	???:0
    0x5608cd30a47e fatal
	lightningd/log.c:819
    0x5608cd3430c5 offer_status_in_db
	wallet/wallet.h:1424
    0x5608cd34f1f3 wallet_offer_disable
	wallet/wallet.c:4494
    0x5608cd33ae2e json_disableoffer
	lightningd/offer.c:256
    0x5608cd3038fc command_exec
	lightningd/jsonrpc.c:643

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2021-07-21 15:07:44 +09:30
committed by neil saitug
parent 57cc4e3c34
commit 44c469d52b
8 changed files with 13 additions and 9 deletions

View File

@@ -42,7 +42,7 @@ On success, an object is returned, containing:
.IP \[bu]
\fBoffer_id\fR (hex): the merkle hash of the offer (always 64 characters)
.IP \[bu]
\fBactive\fR (boolean): Whether the offer can produce invoices/payments (always "false")
\fBactive\fR (boolean): Whether the offer can produce invoices/payments (always \fIfalse\fR)
.IP \[bu]
\fBsingle_use\fR (boolean): Whether the offer is disabled after first successful use
.IP \[bu]
@@ -80,4 +80,4 @@ Rusty Russell \fI<rusty@rustcorp.com.au\fR> is mainly responsible\.
Main web site: \fIhttps://github.com/ElementsProject/lightning\fR
\" SHA256STAMP:2383f44a3bcc1023d6619f5ead4c27d7b2bd9a52bd64d00142fd26658a49dd32
\" SHA256STAMP:e905cb7b8acef73c3ca6bbd41d861234b006aa28185c46b6ba1419c4a0065c3a

View File

@@ -37,7 +37,7 @@ Note: the returned object is the same format as **listoffers**.
[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object is returned, containing:
- **offer_id** (hex): the merkle hash of the offer (always 64 characters)
- **active** (boolean): Whether the offer can produce invoices/payments (always "false")
- **active** (boolean): Whether the offer can produce invoices/payments (always *false*)
- **single_use** (boolean): Whether the offer is disabled after first successful use
- **bolt12** (string): The bolt12 string representing this offer
- **bolt12_unsigned** (string): The bolt12 string representing this offer, without signature
@@ -73,4 +73,4 @@ RESOURCES
---------
Main web site: <https://github.com/ElementsProject/lightning>
[comment]: # ( SHA256STAMP:5b96eca3e35f6c556b93db1743c617b59e69058c9421ece9cc99a9c8814c176b)
[comment]: # ( SHA256STAMP:8f0595c22a7684d99da3000cc19b2465991fa1d2ee435a395b7a1527330aa490)

View File

@@ -12,7 +12,7 @@
},
"active": {
"type": "boolean",
"enum": [ "false" ],
"enum": [ false ],
"description": "Whether the offer can produce invoices/payments"
},
"single_use": {