Skip to content

Commit ec78465

Browse files
UdjinM6PastaPastaPasta
authored andcommitted
fix: move BuildSimplifiedMNListDiff for block h
1 parent 2a12ff6 commit ec78465

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/llmq/snapshot.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,17 +145,12 @@ bool BuildQuorumRotationInfo(CDeterministicMNManager& dmnman, CQuorumSnapshotMan
145145
return false;
146146
}
147147

148-
const CBlockIndex* pWorkBlockIndex = hBlockIndex->GetAncestor(hBlockIndex->nHeight - workDiff);
149-
if (!pWorkBlockIndex) {
148+
const CBlockIndex* pWorkBlockHIndex = hBlockIndex->GetAncestor(hBlockIndex->nHeight - workDiff);
149+
if (!pWorkBlockHIndex) {
150150
errorRet = strprintf("Can not find work block H");
151151
return false;
152152
}
153153

154-
//Build MN list Diff always with highest baseblock
155-
if (!BuildSimplifiedMNListDiff(dmnman, chainman, qblockman, qman, GetLastBaseBlockHash(baseBlockIndexes, pWorkBlockIndex), pWorkBlockIndex->GetBlockHash(), response.mnListDiffH, errorRet)) {
156-
return false;
157-
}
158-
159154
const CBlockIndex* pBlockHMinusCIndex = tipBlockIndex->GetAncestor(hBlockIndex->nHeight - cycleLength);
160155
if (!pBlockHMinusCIndex) {
161156
errorRet = strprintf("Can not find block H-C");
@@ -318,7 +313,12 @@ bool BuildQuorumRotationInfo(CDeterministicMNManager& dmnman, CQuorumSnapshotMan
318313
return false;
319314
}
320315
baseBlockIndexes.push_back(pWorkBlockHMinusCIndex);
321-
316+
317+
if (!BuildSimplifiedMNListDiff(dmnman, chainman, qblockman, qman, GetLastBaseBlockHash(baseBlockIndexes, pWorkBlockHIndex), pWorkBlockHIndex->GetBlockHash(), response.mnListDiffH, errorRet)) {
318+
return false;
319+
}
320+
baseBlockIndexes.push_back(pWorkBlockHIndex);
321+
322322
if (!BuildSimplifiedMNListDiff(dmnman, chainman, qblockman, qman, baseBlockIndexes.back()->GetBlockHash(), tipBlockIndex->GetBlockHash(), response.mnListDiffTip, errorRet)) {
323323
return false;
324324
}

0 commit comments

Comments
 (0)