Skip to content

Commit 3f96d12

Browse files
authored
Merge pull request lightningdevkit#4201 from tnull/2025-10-dont-prune-pending-requests-on-persist
Don't prune `pending_requests` in `persist`
2 parents cd25ef1 + 5f8c54a commit 3f96d12

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lightning-liquidity/src/lsps2/service.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ impl PeerState {
619619
self.needs_persist |= true;
620620
}
621621

622-
fn prune_expired_request_state(&mut self) {
622+
fn prune_pending_requests(&mut self) {
623623
self.pending_requests.retain(|_, entry| {
624624
match entry {
625625
LSPS2Request::GetInfo(_) => false,
@@ -629,7 +629,9 @@ impl PeerState {
629629
},
630630
}
631631
});
632+
}
632633

634+
fn prune_expired_request_state(&mut self) {
633635
self.outbound_channels_by_intercept_scid.retain(|intercept_scid, entry| {
634636
if entry.is_prunable() {
635637
// We abort the flow, and prune any data kept.
@@ -1875,6 +1877,7 @@ where
18751877
let mut peer_state_lock = inner_state_lock.lock().unwrap();
18761878
// We clean up the peer state, but leave removing the peer entry to the prune logic in
18771879
// `persist` which removes it from the store.
1880+
peer_state_lock.prune_pending_requests();
18781881
peer_state_lock.prune_expired_request_state();
18791882
}
18801883
}

0 commit comments

Comments
 (0)