Skip to content

Commit 6798730

Browse files
committed
Use blockhash, not bank hash, for vote txs
1 parent 307d267 commit 6798730

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/replay/consensus/core.zig

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1453,9 +1453,13 @@ fn generateVoteTx(
14531453
);
14541454
defer vote_ix.deinit(allocator);
14551455

1456-
const blockhash = slot_info.state.hash.readCopy() orelse {
1457-
logger.warn().logf("Blockhash is null for slot {}", .{last_voted_slot});
1458-
return .failed;
1456+
const blockhash = blk: {
1457+
const bhq, var bhq_lg = slot_info.state.blockhash_queue.readWithLock();
1458+
defer bhq_lg.unlock();
1459+
break :blk bhq.last_hash orelse {
1460+
logger.warn().logf("Blockhash is null for slot {}", .{last_voted_slot});
1461+
return .failed;
1462+
};
14591463
};
14601464

14611465
const vote_tx_msg = try sig.core.transaction.Message.initCompile(

0 commit comments

Comments
 (0)