Skip to content

Commit 144896a

Browse files
committed
Clean up claimable_outpoints when pending_claim_requests is cleaned
When claimable_outpoints was introduced in "Move our_claim_txn_waiting_first_conf to pending_claim_requests", removal of elements from it (which are just pointers into pending_claim_requests) was never added.
1 parent 0dfe611 commit 144896a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lightning/src/ln/channelmonitor.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2491,8 +2491,13 @@ impl ChannelMonitor {
24912491
for ev in events {
24922492
match ev {
24932493
OnchainEvent::Claim { claim_request } => {
2494-
// We may remove a whole set of claim outpoints here, as these one may have been aggregated in a single tx and claimed so atomically
2495-
self.pending_claim_requests.remove(&claim_request);
2494+
// We may remove a whole set of claim outpoints here, as these one may have
2495+
// been aggregated in a single tx and claimed so atomically
2496+
if let Some(bump_material) = self.pending_claim_requests.remove(&claim_request) {
2497+
for outpoint in bump_material.per_input_material.keys() {
2498+
self.claimable_outpoints.remove(&outpoint);
2499+
}
2500+
}
24962501
},
24972502
OnchainEvent::HTLCUpdate { htlc_update } => {
24982503
log_trace!(self, "HTLC {} failure update has got enough confirmations to be passed upstream", log_bytes!((htlc_update.1).0));

0 commit comments

Comments
 (0)