Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions common/jsonrpc_errors.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ enum jsonrpc_errcode {
OFFER_BAD_INVREQ_REPLY = 1004,
OFFER_TIMEOUT = 1005,
OFFER_ALREADY_ENABLED = 1006,
OFFER_USED_SINGLE_USE = 1007,

/* Errors from datastore command */
DATASTORE_DEL_DOES_NOT_EXIST = 1200,
Expand Down
4 changes: 4 additions & 0 deletions lightningd/offer.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,10 @@ static struct command_result *json_enableoffer(struct command *cmd,
return command_fail(cmd, OFFER_ALREADY_ENABLED,
"offer already active");

if (offer_status_single(status) && offer_status_used(status))
return command_fail(cmd, OFFER_USED_SINGLE_USE,
"cannot activate an used single use offer");

if (command_check_only(cmd))
return command_check_done(cmd);

Expand Down
Loading