lightningd: don't allow enableoffer on single-use offer.

Changelog-Fixed: enableoffer: Adding an error when trying to activate an used single use offer (don't crash!)
This commit is contained in:
21M4TW
2026-01-28 15:23:11 +10:30
committed by Rusty Russell
parent e2d17cea0c
commit d76e4e7149
3 changed files with 5 additions and 1 deletions

View File

@@ -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);