Skip to content

Commit

Permalink
Merge branch 'main' into dnut/feat/window
Browse files Browse the repository at this point in the history
  • Loading branch information
dnut authored Dec 20, 2024
2 parents d6c86a6 + 1e0a16d commit 65e7e7c
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/shred_network/turbine_tree.zig
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,17 @@ pub const TurbineTree = struct {
staked_nodes: *const std.AutoArrayHashMapUnmanaged(Pubkey, u64),
use_stake_hack_for_testing: bool,
) !TurbineTree {
const gossip_table, var gossip_table_lg = gossip_table_rw.readWithLock();
defer gossip_table_lg.unlock();

const gossip_peers = try gossip_table.getThreadSafeContactInfosMatchingShredVersion(
allocator,
&my_contact_info.pubkey,
my_contact_info.shred_version,
0,
);
const gossip_peers = blk: {
const gossip_table, var gossip_table_lg = gossip_table_rw.readWithLock();
defer gossip_table_lg.unlock();

break :blk try gossip_table.getThreadSafeContactInfosMatchingShredVersion(
allocator,
&my_contact_info.pubkey,
my_contact_info.shred_version,
0,
);
};
defer gossip_peers.deinit();

const nodes = try collectTvuAndStakedNodes(
Expand Down

0 comments on commit 65e7e7c

Please sign in to comment.