Merge PR 'Fix hang in `test_single_channel_multiple_mpp` on busy machines' (#5131)
What changed, and why it matters
This commit fixes a flaky test that could hang on busy machines. It does not change production code behavior or fix any security vulnerability in the software itself. The rest of the patch is minor code cleanup, such as switching to newer Rust syntax for formatting strings and constructing vectors.
No security action required. Treat as normal test reliability and code-quality maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The bulk of the change is in lightning/src/ln/chanmon_update_fail_tests.rs, where test_single_channel_multiple_mpp is refactored to avoid a race/hang in the test harness on heavily loaded machines. A helper release_writes_while is introduced to unblock ChannelMonitorUpdates from a background thread while the main thread performs operations that need the peer lock. The remaining diffs are idiomatic Rust cleanups: replacing vec!() with vec![], removing unnecessary & in format! arguments, and using then_some instead of Some(()).filter. No production security logic is altered.
Changed components
test: chanmon_update_fail_tests.rsstyle/refactor: channelmonitor.rsstyle/refactor: package.rsstyle/refactor: channel.rsstyle/refactor: channelmanager.rsstyle/refactor: inbound_payment.rsstyle/refactor: onion_utils.rsstyle/refactor: peer_channel_encryptor.rsstyle/refactor: peer_handler.rsstyle/refactor: gossip.rsstyle/refactor: router.rsInspect captured patch +121 / −112
### lightning/src/chain/channelmonitor.rs
@@ -7718,7 +7718,7 @@ mod tests {
let witness = $sighash_parts.witness_mut($idx).unwrap();
witness.push(ser_sig);
if *$weight == WEIGHT_REVOKED_OUTPUT {
- witness.push(vec!(1));
+ witness.push(vec![1]);
} else if *$weight == weight_revoked_offered_htlc($opt_anchors) || *$weight == weight_revoked_received_htlc($opt_anchors) {
witness.push(pubkey.clone().serialize().to_vec());
} else if *$weight == weight_received_htlc($opt_anchors) {
### lightning/src/chain/package.rs
@@ -901,7 +901,7 @@ impl PackageSolvingData {
let mut ser_sig = sig.serialize_der().to_vec();
ser_sig.push(EcdsaSighashType::All as u8);
bumped_tx.input[i].witness.push(ser_sig);
- bumped_tx.input[i].witness.push(vec!(1));
+ bumped_tx.input[i].witness.push(vec![1]);
bumped_tx.input[i].witness.push(witness_script.clone().into_bytes());
} else { return false; }
},
### lightning/src/ln/chanmon_update_fail_tests.rs
@@ -4664,6 +4664,8 @@ fn test_claim_to_closed_channel_blocks_claimed_event() {
fn test_single_channel_multiple_mpp() {
use crate::util::config::UserConfig;
use std::sync::atomic::{AtomicBool, Ordering};
+ use std::sync::mpsc::{SyncSender, TrySendError};
+ use std::time::Duration;
// Test what happens when we attempt to claim an MPP with many parts that came to us through
// the same channel with a synchronous persistence interface which has very high latency.
@@ -4701,23 +4703,58 @@ fn test_single_channel_multiple_mpp() {
// robust is rather challenging. We rely on having the main test thread wait on locks held in
// the background `claim_funds` thread and unlocking when the `claim_funds` thread completes a
// single `ChannelMonitorUpdate`.
- // This thread calls `get_and_clear_pending_msg_events()` and `handle_revoke_and_ack()`, both
- // of which require `ChannelManager` locks, but we have to make sure this thread gets a chance
- // to be blocked on the mutexes before we let the background thread wake `claim_funds` so that
- // the mutex can switch to this main thread.
+ // This thread fetches pending messages and calls `handle_revoke_and_ack()`, both of which
+ // require `ChannelManager` locks, but we have to make sure this thread gets a chance to be
+ // blocked on the mutexes before we let the background thread wake `claim_funds` so that the
+ // mutex can switch to this main thread.
// This relies on our locks being fair, but also on our threads getting runtime during the test
// run, which can be pretty competitive. Thus we do a dumb dance to be as conservative as
- // possible - we have a background thread which completes a `ChannelMonitorUpdate` (by sending
- // into the `write_blocker` mpsc) but it doesn't run until a mpsc channel sends from this main
- // thread to the background thread, and then we let it sleep a while before we send the
- // `ChannelMonitorUpdate` unblocker.
- // Further, we give ourselves two chances each time, needing 4 HTLCs just to unlock our two
- // `ChannelManager` calls. We then need a few remaining HTLCs to actually trigger the bug, so
+ // possible - while this thread is in such a call, a background thread repeatedly sleeps a
+ // while and then completes a single `ChannelMonitorUpdate` (by sending into the
+ // `write_blocker` mpsc), until the call returns.
+ // Further, we complete at least two `ChannelMonitorUpdate`s while fetching the first
+ // `commitment_signed` so that some HTLC claims are in the holding cell when the
+ // `revoke_and_ack` arrives. We then need a few remaining HTLCs to actually trigger the bug, so
// we use 6 HTLCs.
// Finaly, we do not run this test on Winblowz because it, somehow, in 2025, does not implement
// actual preemptive multitasking and thinks that cooperative multitasking somehow is
// acceptable in the 21st century, let alone a quarter of the way into it.
- const MAX_THREAD_INIT_TIME: std::time::Duration = std::time::Duration::from_secs(1);
+ const MAX_THREAD_INIT_TIME: Duration = Duration::from_secs(1);
+
+ // Runs `f` while completing blocked `ChannelMonitorUpdate`s one at a time from a background
+ // thread, sleeping for `delay` before each, until `f` has returned and at least `min_writes`
+ // have been completed.
+ fn release_writes_while<R>(
+ do_a_write: &SyncSender<()>, min_writes: usize, delay: Duration, f: impl FnOnce() -> R,
+ ) -> R {
+ let done = Arc::new(AtomicBool::new(false));
+ let releaser = {
+ let (do_a_write, done) = (do_a_write.clone(), Arc::clone(&done));
+ std::thread::spawn(move || {
+ let mut writes = 0;
+ let keep_going = |writes| writes < min_writes || !done.load(Ordering::Acquire);
+ while keep_going(writes) {
+ std::thread::sleep(delay);
+ // Only complete a `ChannelMonitorUpdate` once one is waiting, rather than
+ // blocking in `send`, as `f` may return without needing any more.
+ while keep_going(writes) {
+ match do_a_write.try_send(()) {
+ Ok(()) => {
+ writes += 1;
+ break;
+ },
+ Err(TrySendError::Full(())) => std::thread::yield_now(),
+ Err(TrySendError::Disconnected(())) => panic!(),
+ }
+ }
+ }
+ })
+ };
+ let res = f();
+ done.store(true, Ordering::Release);
+ releaser.join().unwrap();
+ res
+ }
create_announced_chan_between_nodes_with_value(&nodes, 0, 1, 100_000, 0);
create_announced_chan_between_nodes_with_value(&nodes, 0, 2, 100_000, 0);
@@ -4793,30 +4830,31 @@ fn test_single_channel_multiple_mpp() {
}
});
- // Then fetch the `update_fulfill_htlc`/`commitment_signed`. Note that the
- // `get_and_clear_pending_msg_events` will immediately hang trying to take a peer lock which
- // `claim_funds` is holding. Thus, we release a second write after a small sleep in the
- // background to give `claim_funds` a chance to step forward, unblocking
- // `get_and_clear_pending_msg_events`.
- let do_a_write_background = do_a_write.clone();
- let block_thrd2 = AtomicBool::new(true);
- let block_thrd2_read: &'static AtomicBool = unsafe { std::mem::transmute(&block_thrd2) };
- let thrd2 = std::thread::spawn(move || {
- while block_thrd2_read.load(Ordering::Acquire) {
- std::thread::yield_now();
- }
- std::thread::sleep(MAX_THREAD_INIT_TIME);
- do_a_write_background.send(()).unwrap();
- std::thread::sleep(MAX_THREAD_INIT_TIME);
- do_a_write_background.send(()).unwrap();
+ // Then fetch the `update_fulfill_htlc`/`commitment_signed`. Note that this will immediately
+ // hang trying to take a peer lock which `claim_funds` is holding, so we have to release writes
+ // to give `claim_funds` a chance to step forward.
+ // We take the peer lock directly rather than calling `get_and_clear_pending_msg_events`, which
+ // takes it several times, as on a busy machine we may only get the lock once per
+ // `ChannelMonitorUpdate` and could run out of HTLC claims before getting the messages.
+ // The event thread may also be waiting on the peer lock to handle the `PaymentClaimed` event's
+ // completion action, so we wait for it before we stop releasing writes as well.
+ let mut msg_events = release_writes_while(&do_a_write, 2, MAX_THREAD_INIT_TIME, || {
+ let msg_events = {
+ let per_peer_state = nodes[8].node.per_peer_state.read().unwrap();
+ let mut peer_state = per_peer_state.get(&node_h_id).unwrap().lock().unwrap();
+ std::mem::take(&mut peer_state.pending_msg_events)
+ };
+ thrd_event.join().unwrap();
+ msg_events
});
- block_thrd2.store(false, Ordering::Release);
- let mut first_updates = get_htlc_update_msgs(&nodes[8], &node_h_id);
-
- // Thread 2 could unblock first, or it could get blocked waiting on us to process a
- // `PaymentClaimed` event. Either way, wait until both have finished.
- thrd2.join().unwrap();
- thrd_event.join().unwrap();
+ assert_eq!(msg_events.len(), 1);
+ let mut first_updates = match msg_events.pop().unwrap() {
+ MessageSendEvent::UpdateHTLCs { node_id, updates, .. } => {
+ assert_eq!(node_id, node_h_id);
+ updates
+ },
+ ev => panic!("Unexpected event {ev:?}"),
+ };
// Disconnect node 6 from all its peers so it doesn't bother to fail the HTLCs back
nodes[7].node.peer_disconnected(node_b_id);
@@ -4834,34 +4872,16 @@ fn test_single_channel_multiple_mpp() {
check_added_monitors(&nodes[7], 1);
let (raa, cs) = get_revoke_commit_msgs(&nodes[7], &node_i_id);
- // Now, handle the `revoke_and_ack` from node 5. Note that `claim_funds` is still blocked on
- // our peer lock, so we have to release a write to let it process.
+ // Now, handle the `revoke_and_ack` from node 7. Note that `claim_funds` is still blocked on
+ // our peer lock, so we have to release writes to let it process.
// After this call completes, the channel previously would be locked up and should not be able
// to make further progress.
- let do_a_write_background = do_a_write.clone();
- let block_thrd3 = AtomicBool::new(true);
- let block_thrd3_read: &'static AtomicBool = unsafe { std::mem::transmute(&block_thrd3) };
- let thrd3 = std::thread::spawn(move || {
- while block_thrd3_read.load(Ordering::Acquire) {
- std::thread::yield_now();
- }
- std::thread::sleep(MAX_THREAD_INIT_TIME);
- do_a_write_background.send(()).unwrap();
- std::thread::sleep(MAX_THREAD_INIT_TIME);
- do_a_write_background.send(()).unwrap();
+ release_writes_while(&do_a_write, 0, MAX_THREAD_INIT_TIME, || {
+ nodes[8].node.handle_revoke_and_ack(node_h_id, &raa);
});
- block_thrd3.store(false, Ordering::Release);
- nodes[8].node.handle_revoke_and_ack(node_h_id, &raa);
- thrd3.join().unwrap();
assert!(!thrd.is_finished());
- let thrd4 = std::thread::spawn(move || {
- do_a_write.send(()).unwrap();
- do_a_write.send(()).unwrap();
- });
-
- thrd4.join().unwrap();
- thrd.join().unwrap();
+ release_writes_while(&do_a_write, 0, Duration::ZERO, || thrd.join().unwrap());
// At the end, we should have 7 ChannelMonitorUpdates - 6 for HTLC claims, and one for the
// above `revoke_and_ack`.
@@ -4872,53 +4892,42 @@ fn test_single_channel_multiple_mpp() {
nodes[8].node.handle_commitment_signed_batch_test(node_h_id, &cs);
check_added_monitors(&nodes[8], 1);
- let (mut updates, raa) = get_updates_and_revoke(&nodes[8], &node_h_id);
+ // The HTLC claims which were in the holding cell when the `revoke_and_ack` arrived come first,
+ // followed by the rest once node 7 revokes again. How many are in each depends on how far
+ // `claim_funds` got before the `revoke_and_ack` was handled.
+ let (updates, raa) = get_updates_and_revoke(&nodes[8], &node_h_id);
- nodes[7].node.handle_update_fulfill_htlc(node_i_id, updates.update_fulfill_htlcs.remove(0));
- expect_payment_forwarded!(nodes[7], nodes[2], nodes[8], Some(1000), false, false);
- nodes[7].node.handle_update_fulfill_htlc(node_i_id, updates.update_fulfill_htlcs.remove(0));
- expect_payment_forwarded!(nodes[7], nodes[3], nodes[8], Some(1000), false, false);
- let mut next_source = 4;
- if let Some(update) = updates.update_fulfill_htlcs.get(0) {
- nodes[7].node.handle_update_fulfill_htlc(node_i_id, update.clone());
- expect_payment_forwarded!(nodes[7], nodes[4], nodes[8], Some(1000), false, false);
+ let mut next_source = 2;
+ let claims = updates.update_fulfill_htlcs.len();
+ for update in updates.update_fulfill_htlcs {
+ nodes[7].node.handle_update_fulfill_htlc(node_i_id, update);
+ expect_payment_forwarded!(nodes[7], nodes[next_source], nodes[8], Some(1000), false, false);
next_source += 1;
}
nodes[7].node.handle_commitment_signed_batch_test(node_i_id, &updates.commitment_signed);
nodes[7].node.handle_revoke_and_ack(node_i_id, &raa);
- if updates.update_fulfill_htlcs.get(0).is_some() {
- check_added_monitors(&nodes[7], 5);
- } else {
- check_added_monitors(&nodes[7], 4);
- }
+ check_added_monitors(&nodes[7], claims + 2);
let (raa, cs) = get_revoke_commit_msgs(&nodes[7], &node_i_id);
nodes[8].node.handle_revoke_and_ack(node_h_id, &raa);
nodes[8].node.handle_commitment_signed_batch_test(node_h_id, &cs);
check_added_monitors(&nodes[8], 2);
- let (mut updates, raa) = get_updates_and_revoke(&nodes[8], &node_h_id);
+ let (updates, raa) = get_updates_and_revoke(&nodes[8], &node_h_id);
- nodes[7].node.handle_update_fulfill_htlc(node_i_id, updates.update_fulfill_htlcs.remove(0));
- expect_payment_forwarded!(nodes[7], nodes[next_source], nodes[8], Some(1000), false, false);
- next_source += 1;
- nodes[7].node.handle_update_fulfill_htlc(node_i_id, updates.update_fulfill_htlcs.remove(0));
- expect_payment_forwarded!(nodes[7], nodes[next_source], nodes[8], Some(1000), false, false);
- next_source += 1;
- if let Some(update) = updates.update_fulfill_htlcs.get(0) {
- nodes[7].node.handle_update_fulfill_htlc(node_i_id, update.clone());
+ let claims = updates.update_fulfill_htlcs.len();
+ for update in updates.update_fulfill_htlcs {
+ nodes[7].node.handle_update_fulfill_htlc(node_i_id, update);
expect_payment_forwarded!(nodes[7], nodes[next_source], nodes[8], Some(1000), false, false);
+ next_source += 1;
}
+ assert_eq!(next_source, 7);
nodes[7].node.handle_commitment_signed_batch_test(node_i_id, &updates.commitment_signed);
nodes[7].node.handle_revoke_and_ack(node_i_id, &raa);
- if updates.update_fulfill_htlcs.get(0).is_some() {
- check_added_monitors(&nodes[7], 5);
- } else {
- check_added_monitors(&nodes[7], 4);
- }
+ check_added_monitors(&nodes[7], claims + 2);
let (raa, cs) = get_revoke_commit_msgs(&nodes[7], &node_i_id);
nodes[8].node.handle_revoke_and_ack(node_h_id, &raa);
### lightning/src/ln/channel.rs
@@ -13026,13 +13026,13 @@ where
if self.context.secp_ctx.verify_ecdsa(&msghash, &msg.node_signature, &self.context.get_counterparty_node_id()).is_err() {
return Err(ChannelError::close(format!(
- "Bad announcement_signatures. Failed to verify node_signature. UnsignedChannelAnnouncement used for verification is {:?}. their_node_key is {:?}",
- &announcement, self.context.get_counterparty_node_id())));
+ "Bad announcement_signatures. Failed to verify node_signature. UnsignedChannelAnnouncement used for verification is {announcement:?}. their_node_key is {:?}",
+ self.context.get_counterparty_node_id())));
}
if self.context.secp_ctx.verify_ecdsa(&msghash, &msg.bitcoin_signature, self.funding.counterparty_funding_pubkey()).is_err() {
return Err(ChannelError::close(format!(
- "Bad announcement_signatures. Failed to verify bitcoin_signature. UnsignedChannelAnnouncement used for verification is {:?}. their_bitcoin_key is ({:?})",
- &announcement, self.funding.counterparty_funding_pubkey())));
+ "Bad announcement_signatures. Failed to verify bitcoin_signature. UnsignedChannelAnnouncement used for verification is {announcement:?}. their_bitcoin_key is ({:?})",
+ self.funding.counterparty_funding_pubkey())));
}
self.context.announcement_sigs = Some((msg.node_signature, msg.bitcoin_signature));
@@ -15607,7 +15607,7 @@ impl<SP: SignerProvider> OutboundV1Channel<SP> {
debug_assert!(self.funding.funding_transaction.is_none());
self.funding.funding_transaction = Some(funding_transaction);
- self.context.is_batch_funding = Some(()).filter(|_| is_batch_funding);
+ self.context.is_batch_funding = is_batch_funding.then_some(());
let funding_created = self.get_funding_created_msg(logger);
Ok(funding_created)
### lightning/src/ln/channelmanager.rs
@@ -12626,7 +12626,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
"Lost channel state for channel {}.\n\
Received peer storage with a more recent state than what our node had.\n\
Use the FundRecoverer to initiate a force close and sweep the funds.",
- &mon_holder.channel_id
+ mon_holder.channel_id
);
}
}
### lightning/src/ln/inbound_payment.rs
@@ -534,8 +534,7 @@ pub(super) fn get_payment_preimage(
)
.map_err(|bad_preimage_bytes| APIError::APIMisuseError {
err: format!(
- "Payment hash {} did not match decoded preimage {}",
- &payment_hash,
+ "Payment hash {payment_hash} did not match decoded preimage {}",
log_bytes!(bad_preimage_bytes)
),
})?;
### lightning/src/ln/onion_utils.rs
@@ -3486,7 +3486,7 @@ mod tests {
// Note that we represent the test vector payloads 2 and 5 through RawOnionHopData::data
// with raw hex instead of our in-memory enums, as the payloads contains custom types, and
// we have no way of representing that with our enums.
- let payloads = vec!(
+ let payloads = vec![
RawOnionHopData::new(msgs::OutboundOnionPayload::Forward {
short_channel_id: 1,
amt_to_forward: 15000,
@@ -3538,7 +3538,7 @@ mod tests {
RawOnionHopData {
data: <Vec<u8>>::from_hex("fd011002022710040203e8082224a33562c54507a9334e79f0dc4f17d407e6d7c61f0e2f3d0d38599502f617042710fd012de02a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a").unwrap(),
},
- );
+ ];
// Verify that the serialized OnionHopDataFormat::NonFinalNode tlv payloads matches the test vectors
let mut w = VecWriter(Vec::new());
### lightning/src/ln/peer_channel_encryptor.rs
@@ -261,7 +261,7 @@ impl PeerChannelEncryptor {
let their_pub = match PublicKey::from_slice(&act[1..34]) {
Err(_) => {
return Err(LightningError {
- err: format!("Invalid public key {}", &act[1..34].as_hex()),
+ err: format!("Invalid public key {}", act[1..34].as_hex()),
action: msgs::ErrorAction::DisconnectPeer { msg: None },
})
},
@@ -472,7 +472,7 @@ impl PeerChannelEncryptor {
Ok(key) => key,
Err(_) => {
return Err(LightningError {
- err: format!("Bad node_id from peer, {}", &their_node_id.as_hex()),
+ err: format!("Bad node_id from peer, {}", their_node_id.as_hex()),
action: msgs::ErrorAction::DisconnectPeer { msg: None },
})
},
### lightning/src/ln/peer_handler.rs
@@ -2236,8 +2236,8 @@ impl<
if let Message::StartBatch(msg) = message {
if peer_lock.message_batch.is_some() {
let error = format!(
- "Peer {} sent start_batch for channel {} before previous batch completed",
- their_node_id, &msg.channel_id
+ "Peer {their_node_id} sent start_batch for channel {} before previous batch completed",
+ msg.channel_id
);
log_debug!(logger, "{}", error);
return Err(LightningError {
@@ -2252,8 +2252,8 @@ impl<
let batch_size = msg.batch_size as usize;
if batch_size <= 1 {
let error = format!(
- "Peer {} sent start_batch for channel {} not strictly greater than 1",
- their_node_id, &msg.channel_id
+ "Peer {their_node_id} sent start_batch for channel {} not strictly greater than 1",
+ msg.channel_id
);
log_debug!(logger, "{}", error);
return Err(LightningError {
@@ -2269,8 +2269,8 @@ impl<
const BATCH_SIZE_LIMIT: usize = 20;
if batch_size > BATCH_SIZE_LIMIT {
let error = format!(
- "Peer {} sent start_batch for channel {} exceeding the limit",
- their_node_id, &msg.channel_id
+ "Peer {their_node_id} sent start_batch for channel {} exceeding the limit",
+ msg.channel_id
);
log_debug!(logger, "{}", error);
return Err(LightningError {
@@ -2310,7 +2310,7 @@ impl<
&mut message_batch.messages;
if msg.channel_id != message_batch.channel_id {
- let error = format!("Peer {} sent batched commitment_signed for the wrong channel (expected: {}, actual: {})", their_node_id, message_batch.channel_id, &msg.channel_id);
+ let error = format!("Peer {their_node_id} sent batched commitment_signed for the wrong channel (expected: {}, actual: {})", message_batch.channel_id, msg.channel_id);
log_debug!(logger, "{}", error);
return Err(LightningError {
err: error.clone(),
### lightning/src/routing/gossip.rs
@@ -1112,9 +1112,9 @@ impl fmt::Display for ChannelInfo {
f,
"features: {}, node_one: {}, one_to_two: {:?}, node_two: {}, two_to_one: {:?}",
log_bytes!(self.features.encode()),
- &self.node_one,
+ self.node_one,
self.one_to_two,
- &self.node_two,
+ self.node_two,
self.two_to_one
)?;
Ok(())
@@ -1730,11 +1730,11 @@ impl<L: Logger> fmt::Display for NetworkGraph<L> {
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
writeln!(f, "Network map\n[Channels]")?;
for (key, val) in self.channels.read().unwrap().unordered_iter() {
- writeln!(f, " {}: {}", key, val)?;
+ writeln!(f, " {key}: {val}")?;
}
writeln!(f, "[Nodes]")?;
for (&node_id, val) in self.nodes.read().unwrap().unordered_iter() {
- writeln!(f, " {}: {}", &node_id, val)?;
+ writeln!(f, " {node_id}: {val}")?;
}
Ok(())
}
@@ -2193,7 +2193,7 @@ impl<L: Logger> NetworkGraph<L> {
|| removed_nodes.contains_key(&msg.node_id_2)
{
return Err(LightningError{
- err: format!("Channel with SCID {} or one of its nodes was removed from our network graph recently", &msg.short_channel_id),
+ err: format!("Channel with SCID {} or one of its nodes was removed from our network graph recently", msg.short_channel_id),
action: ErrorAction::IgnoreAndLog(Level::Gossip)});
}
}
### lightning/src/routing/router.rs
@@ -3735,7 +3735,8 @@ pub(crate) fn get_route<L: Logger, S: ScoreLookUp>(
// traversing the graph and arrange the path out of what we found.
if node_counter == payer_node_counter {
let mut new_entry = dist[payer_node_counter as usize].take().unwrap();
- let mut ordered_hops: Vec<(PathBuildingHop, NodeFeatures)> = vec!((new_entry.clone(), default_node_features.clone()));
+ let mut ordered_hops: Vec<(PathBuildingHop, NodeFeatures)> =
+ vec![(new_entry.clone(), default_node_features.clone())];
'path_walk: loop {
let mut features_set = false;Why this scored 14/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.