Skip to content

Commit

Permalink
fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexicon226 committed Nov 27, 2024
1 parent 25afde4 commit 08c974d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/net/quic_client.zig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const Packet = sig.net.Packet;
const Channel = sig.sync.Channel;
const AtomicBool = std.atomic.Value(bool);
const Logger = sig.trace.log.Logger;
const ChannelPrintLogger = sig.trace.log.ChannelPrintLogger;

pub fn runClient(
allocator: std.mem.Allocator,
Expand Down
12 changes: 9 additions & 3 deletions src/transaction_sender/leader_info.zig
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,22 @@ pub const LeaderInfo = struct {
}

fn updateLeaderAddressesCache(self: *LeaderInfo) !void {
const gossip_table: *const GossipTable, var gossip_table_lg = self.gossip_table_rw.readWithLock();
const gossip_table: *const GossipTable, var gossip_table_lg =
self.gossip_table_rw.readWithLock();
defer gossip_table_lg.unlock();

const unique_leaders = try self.leader_schedule_cache.uniqueLeaders(self.allocator);
defer self.allocator.free(unique_leaders);

for (unique_leaders) |leader| {
const contact_info = gossip_table.getThreadSafeContactInfo(leader);
if (contact_info == null or contact_info.?.tpu_quic_addr == null) continue;
try self.leader_addresses_cache.put(self.allocator, leader, contact_info.?.tpu_quic_addr.?);
if (contact_info == null or
contact_info.?.tpu_quic_addr == null) continue;
try self.leader_addresses_cache.put(
self.allocator,
leader,
contact_info.?.tpu_quic_addr.?,
);
}
}

Expand Down

0 comments on commit 08c974d

Please sign in to comment.