plugins: recover awaiting channels after init
What changed, and why it matters
This commit removes a 180-second startup delay before the 'spender' plugin checks for Lightning channels that were stuck waiting for a signature after a crash. The change makes recovery happen immediately at startup instead of waiting three minutes. The commit message says this is intentional and safe, because the previous delay was only a workaround to avoid slowing down other plugins during startup. There is no direct evidence in the commit that this fixes a security vulnerability; it appears to be a reliability/startup-order change.
Treat as a normal reliability/performance patch unless additional context shows the 180-second delay caused funds to become unrecoverable or exposed to race conditions. Review whether immediate signing during init can reintroduce the original startup-blocking problem on nodes with large wallets. No urgent security deployment is indicated by this diff alone.
Security signals we found
Change removes a startup-delay workaround for slow wallet signing operations
Recovery logic for unsigned PSBTs in AWAITING_LOCKIN now runs immediately at plugin init
Potential denial-of-service or startup-delay side effect if many large PSBTs must be signed synchronously during init
No input validation, cryptographic, or memory-safety changes visible in the diff
Evidence from the diff
In plugins/spender/openchannel.c, the AWAITING_CHANNELS_RECOVERY_DELAY constant (180 seconds) is deleted and the timer that triggers list_awaiting_channels is now scheduled with time_from_sec(0). The list_awaiting_channels callback signs unsigned PSBTs for channels in AWAITING_LOCKIN, treating them as leftover from a crash. The original comment explained that the delay was added so slow wallet signing would not block other builtin plugins’ init handshake. The patch removes that delay entirely rather than making it configurable or conditional.
Changed components
plugins/spender/openchannel.cspender plugin startup / init handshakechannel state recovery for AWAITING_LOCKIN channelsInspect captured patch +1 / −5
diff --git a/plugins/spender/openchannel.c b/plugins/spender/openchannel.c
index 2ff5a570..c0698f3c 100644
--- a/plugins/spender/openchannel.c
+++ b/plugins/spender/openchannel.c
@@ -1078,10 +1078,6 @@ static struct command_result *signpsbt_done(struct command *aux_cmd,
return send_outreq(req);
}
-/* Delay startup recovery so slow wallet signing does not block other
- * important plugins from completing their init handshake. */
-#define AWAITING_CHANNELS_RECOVERY_DELAY 180
-
/* If there are any channels with unsigned PSBTs in AWAITING_LOCKIN,
* sign them now (assume we crashed) */
static struct command_result *list_awaiting_channels(struct command *timer_cmd,
@@ -1138,7 +1134,7 @@ void openchannel_init(struct command *init_cmd, const char *b, const jsmntok_t *
* Signing can be slow on large wallets, and doing it during init can block
* other important builtins from completing their startup handshake. */
global_timer(init_cmd->plugin,
- time_from_sec(AWAITING_CHANNELS_RECOVERY_DELAY),
+ time_from_sec(0),
list_awaiting_channels, NULL);
}
Why this scored 28/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.