Skip to content

Commit

Permalink
fix broadcast
Browse files Browse the repository at this point in the history
  • Loading branch information
qti3e committed Oct 4, 2023
1 parent cce74ca commit 395a5a3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 16 deletions.
5 changes: 0 additions & 5 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3767,15 +3767,10 @@ dependencies = [
"im",
"infusion",
"ink-quill",
"lightning-application",
"lightning-interfaces",
"lightning-metrics",
"lightning-notifier",
"lightning-signer",
"lightning-topology",
"log",
"mini-moka",
"mock",
"rand 0.8.5",
"serde",
"smallvec",
Expand Down
7 changes: 0 additions & 7 deletions core/broadcast/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,3 @@ smallvec = "1.11.0"
ta = "0.5.0"
log.workspace = true
rand.workspace = true

[dev-dependencies]
lightning-application = { path = "../application" }
lightning-signer = { path = "../signer" }
lightning-topology = { path = "../topology" }
lightning-notifier = { path = "../notifier" }
mock = { path = "../mock" }
15 changes: 11 additions & 4 deletions core/broadcast/src/ev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,20 @@ impl<C: Collection> Context<C> {
// This is a new digest which we have never seen before. At this point we immediately
// wanna see the message and therefore we send out the want request.
if new_digest {
// self.peers.send_want_request(&sender, advr.interned_id);
self.send(
sender,
Frame::Want(Want {
interned_id: advr.interned_id,
}),
);
self.pending_store.insert_request(sender, index);
}

// Remember the mapping since we may need it.
// self.peers
// .insert_index_mapping(&sender, index, advr.interned_id);
self.peers
.entry(sender)
.or_default()
.insert(index, advr.interned_id);

// Handle the case for non-first advr.
self.pending_store.insert_pending(sender, index);
Expand Down Expand Up @@ -357,7 +364,7 @@ impl<C: Collection> Context<C> {
peers
.get(&id)
.map(|mapping| !mapping.contains_key(&interned_id))
.unwrap_or(false)
.unwrap_or(true)
});
}

Expand Down

0 comments on commit 395a5a3

Please sign in to comment.