Skip to content

Commit 8e02d4b

Browse files
committed
f - take the SCID of the oldest channel
1 parent 2272d2f commit 8e02d4b

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

lightning/src/ln/channel.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1398,7 +1398,7 @@ pub(super) struct ChannelContext<SP: Deref> where SP::Target: SignerProvider {
13981398
/// Either the height at which this channel was created or the height at which it was last
13991399
/// serialized if it was serialized by versions prior to 0.0.103.
14001400
/// We use this to close if funding is never broadcasted.
1401-
channel_creation_height: u32,
1401+
pub(super) channel_creation_height: u32,
14021402

14031403
counterparty_dust_limit_satoshis: u64,
14041404

lightning/src/ln/channelmanager.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8992,7 +8992,8 @@ where
89928992
node_id: *node_id,
89938993
short_channel_id: peer.channel_by_id
89948994
.iter()
8995-
.find(|(_, channel)| channel.context().is_usable())
8995+
.filter(|(_, channel)| channel.context().is_usable())
8996+
.min_by_key(|(_, channel)| channel.context().channel_creation_height)
89968997
.and_then(|(_, channel)| channel.context().get_short_channel_id()),
89978998
})
89988999
.collect::<Vec<_>>();

lightning/src/onion_message/messenger.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ pub(super) const MAX_TIMER_TICKS: usize = 2;
9898
/// # })
9999
/// # }
100100
/// # fn create_blinded_paths<T: secp256k1::Signing + secp256k1::Verification>(
101-
/// # &self, _recipient: PublicKey, _peers: Vec<PublicKey>, _secp_ctx: &Secp256k1<T>
101+
/// # &self, _recipient: PublicKey, _peers: Vec<ForwardNode>, _secp_ctx: &Secp256k1<T>
102102
/// # ) -> Result<Vec<BlindedPath>, ()> {
103103
/// # unreachable!()
104104
/// # }

0 commit comments

Comments
 (0)