Skip to content

Commit

Permalink
Possible deadlock fix in people.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedilger committed Mar 30, 2024
1 parent b43033b commit 8a3bbfc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gossip-lib/src/people.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,9 @@ impl People {
// again will make any difference. Either the person doesn't have
// metadata or we don't have their proper relays. So a shorter timeout
// in this circumstance isn't such a great idea.
if let Some(fetching_asof) = self.fetching_metadata.get(&pubkey) {
let opt_fetching_asof: Option<Unixtime> =
self.fetching_metadata.get(&pubkey).map(|r| *r.value());
if let Some(fetching_asof) = opt_fetching_asof {
if fetching_asof.0 >= (now - stale).0 {
continue;
} else {
Expand Down

0 comments on commit 8a3bbfc

Please sign in to comment.