Skip to content

Commit 8825fc3

Browse files
committed
Drop disconnecting peers from the list of ignored peers
When a peer misbehaves/sends bogus data we reply with an error message and insert it to the ignored list. Here, we avoid having this list grow unboundedly over time by removing peers again once they disconnect, allowing them a second chance upon reconnection.
1 parent 4cb4d66 commit 8825fc3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lightning-liquidity/src/manager.rs

+3
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,9 @@ where
618618
}
619619

620620
fn peer_disconnected(&self, counterparty_node_id: bitcoin::secp256k1::PublicKey) {
621+
// If the peer was misbehaving, drop it from the ignored list to cleanup the kept state.
622+
self.ignored_peers.write().unwrap().remove(&counterparty_node_id);
623+
621624
if let Some(lsps2_service_handler) = self.lsps2_service_handler.as_ref() {
622625
lsps2_service_handler.peer_disconnected(counterparty_node_id);
623626
}

0 commit comments

Comments
 (0)