From f9a6cb2a8b831da36ba8e29d26ce1fceb122d9c0 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Fri, 23 Apr 2021 23:56:58 +0000 Subject: [PATCH] Fail PendingInboundPayments after their expiry time is reached --- lightning/src/ln/channelmanager.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs index f147a8162..ea3c2be91 100644 --- a/lightning/src/ln/channelmanager.rs +++ b/lightning/src/ln/channelmanager.rs @@ -451,7 +451,7 @@ pub struct ChannelManager>, @@ -3601,6 +3601,10 @@ where } max_time!(self.last_node_announcement_serial); max_time!(self.highest_seen_timestamp); + let mut payment_secrets = self.pending_inbound_payments.lock().unwrap(); + payment_secrets.retain(|_, inbound_payment| { + inbound_payment.expiry_time > header.time as u64 + }); } fn get_relevant_txids(&self) -> Vec { -- 2.39.5