Skip to content

Commit 1fb9132

Browse files
nepetcdecker
authored andcommitted
trampoline: Add channel filter for spendable_msat
It makes more sense to filter directly from the get go instead of skipping channels that have an unsufficient spendable_msat amount and can cause zero value htlcs. Signed-off-by: Peter Neuroth <[email protected]>
1 parent 33eaf96 commit 1fb9132

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

libs/gl-plugin/src/tramp.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,8 @@ pub async fn trampolinepay(
232232
min_htlc_out_msat,
233233
});
234234
})
235+
.filter(|ch| ch.spendable_msat > 0)
236+
.filter(|ch| ch.spendable_msat > ch.min_htlc_out_msat)
235237
.collect();
236238

237239
channels.sort_by(|a, b| b.spendable_msat.cmp(&a.spendable_msat));

0 commit comments

Comments
 (0)