Skip to content

Quick #3010 followups #3311

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lightning/src/ln/offers_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1100,6 +1100,7 @@ fn creates_and_pays_for_offer_with_retry() {
expect_recent_payment!(bob, RecentPaymentDetails::AwaitingInvoice, payment_id);

let _lost_onion_message = bob.onion_messenger.next_onion_message_for_peer(alice_id).unwrap();
assert!(bob.onion_messenger.next_onion_message_for_peer(alice_id).is_none());

// Simulate a scenario where the original onion_message is lost before reaching Alice.
// Use handle_message_received to regenerate the message.
Expand Down
13 changes: 7 additions & 6 deletions lightning/src/ln/peer_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1618,14 +1618,15 @@ impl<Descriptor: SocketDescriptor, CM: Deref, RM: Deref, OM: Deref, L: Deref, CM
let their_node_id = peer_lock.their_node_id.expect("We know the peer's public key by the time we receive messages").0;
let logger = WithContext::from(&self.logger, Some(their_node_id), None, None);

let unprocessed_message = self.do_handle_message_holding_peer_lock(peer_lock, message, their_node_id, &logger)?;

self.message_handler.chan_handler.message_received();

let message = match self.do_handle_message_holding_peer_lock(peer_lock, message, their_node_id, &logger)? {
Some(processed_message) => processed_message,
None => return Ok(None),
};

self.do_handle_message_without_peer_lock(peer_mutex, message, their_node_id, &logger)
if let Some(message) = unprocessed_message {
self.do_handle_message_without_peer_lock(peer_mutex, message, their_node_id, &logger)
} else {
Ok(None)
}
}

// Conducts all message processing that requires us to hold the `peer_lock`.
Expand Down
Loading