Skip to content

Commit 422a695

Browse files
committed
fix: default to genesis block as the last base block
1 parent 1549daa commit 422a695

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/llmq/snapshot.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,11 +392,12 @@ bool BuildQuorumRotationInfo(CDeterministicMNManager& dmnman, CQuorumSnapshotMan
392392
uint256 GetLastBaseBlockHash(Span<const CBlockIndex*> baseBlockIndexes, const CBlockIndex* blockIndex,
393393
bool use_legacy_construction)
394394
{
395-
uint256 hash;
396395
if (!use_legacy_construction) {
397396
std::sort(baseBlockIndexes.begin(), baseBlockIndexes.end(),
398397
[](const CBlockIndex* a, const CBlockIndex* b) { return a->nHeight < b->nHeight; });
399398
}
399+
// default to genesis block
400+
uint256 hash{Params().GenesisBlock().GetHash()};
400401
for (const auto baseBlock : baseBlockIndexes) {
401402
if (baseBlock->nHeight >= blockIndex->nHeight)
402403
break;

0 commit comments

Comments
 (0)