Skip to content

Commit

Permalink
fix: accepting offer with multiple keys (ethereum#1180)
Browse files Browse the repository at this point in the history
  • Loading branch information
morph-dev authored Feb 27, 2024
1 parent 45bb8e5 commit 476cb76
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion portalnet/src/overlay_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1308,6 +1308,8 @@ where
)
})?;

let mut accepted_keys: Vec<TContentKey> = Vec::default();

for (i, key) in content_keys.iter().enumerate() {
// Accept content if within radius and not already present in the data store.
let accept = self
Expand All @@ -1320,6 +1322,9 @@ where
"Unable to check content availability {err}"
))
})?;
if accept {
accepted_keys.push(key.clone());
}
requested_keys.set(i, accept).map_err(|err| {
OverlayRequestError::AcceptError(format!(
"Unable to set requested keys bits: {err:?}"
Expand Down Expand Up @@ -1404,7 +1409,7 @@ where
metrics,
kbuckets,
command_tx,
content_keys,
accepted_keys,
data,
utp.clone(),
)
Expand Down

0 comments on commit 476cb76

Please sign in to comment.