Skip to content

Commit 2f13a42

Browse files
joostjagerclaude
andcommitted
chanmon_consistency: handle missing channel in splice_out
The splice_out closure can be invoked after the channel has already been force-closed by a prior opcode. Return early instead of panicking on unwrap when the channel is no longer listed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 053978a commit 2f13a42

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

fuzz/src/chanmon_consistency.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,12 +1452,15 @@ pub fn do_test<Out: Output + MaybeSend + MaybeSync>(
14521452
// We conditionally splice out `MAX_STD_OUTPUT_DUST_LIMIT_SATOSHIS` only when the node
14531453
// has double the balance required to send a payment upon a `0xff` byte. We do this to
14541454
// ensure there's always liquidity available for a payment to succeed then.
1455-
let outbound_capacity_msat = node
1455+
let outbound_capacity_msat = match node
14561456
.list_channels()
14571457
.iter()
14581458
.find(|chan| chan.channel_id == *channel_id)
14591459
.map(|chan| chan.outbound_capacity_msat)
1460-
.unwrap();
1460+
{
1461+
Some(v) => v,
1462+
None => return,
1463+
};
14611464
if outbound_capacity_msat < 20_000_000 {
14621465
return;
14631466
}

0 commit comments

Comments
 (0)