@@ -113,9 +113,8 @@ bool BuildQuorumRotationInfo(CDeterministicMNManager& dmnman, CQuorumSnapshotMan
113
113
baseBlockIndexes.push_back (blockIndex);
114
114
}
115
115
if (use_legacy_construction) {
116
- std::sort (baseBlockIndexes.begin (), baseBlockIndexes.end (), [](const CBlockIndex* a, const CBlockIndex* b) {
117
- return a->nHeight < b->nHeight ;
118
- });
116
+ std::sort (baseBlockIndexes.begin (), baseBlockIndexes.end (),
117
+ [](const CBlockIndex* a, const CBlockIndex* b) { return a->nHeight < b->nHeight ; });
119
118
}
120
119
}
121
120
@@ -125,8 +124,9 @@ bool BuildQuorumRotationInfo(CDeterministicMNManager& dmnman, CQuorumSnapshotMan
125
124
return false ;
126
125
}
127
126
if (use_legacy_construction) {
128
- // Build MN list Diff always with highest baseblock
129
- if (!BuildSimplifiedMNListDiff (dmnman, chainman, qblockman, qman, baseBlockIndexes.back ()->GetBlockHash (), tipBlockIndex->GetBlockHash (), response.mnListDiffTip , errorRet)) {
127
+ // Build MN list Diff always with highest baseblock
128
+ if (!BuildSimplifiedMNListDiff (dmnman, chainman, qblockman, qman, baseBlockIndexes.back ()->GetBlockHash (),
129
+ tipBlockIndex->GetBlockHash (), response.mnListDiffTip , errorRet)) {
130
130
return false ;
131
131
}
132
132
}
@@ -160,8 +160,10 @@ bool BuildQuorumRotationInfo(CDeterministicMNManager& dmnman, CQuorumSnapshotMan
160
160
}
161
161
162
162
if (use_legacy_construction) {
163
- // Build MN list Diff always with highest baseblock
164
- if (!BuildSimplifiedMNListDiff (dmnman, chainman, qblockman, qman, GetLastBaseBlockHash (baseBlockIndexes, pWorkBlockHIndex, use_legacy_construction), pWorkBlockHIndex->GetBlockHash (), response.mnListDiffH , errorRet)) {
163
+ // Build MN list Diff always with highest baseblock
164
+ if (!BuildSimplifiedMNListDiff (dmnman, chainman, qblockman, qman,
165
+ GetLastBaseBlockHash (baseBlockIndexes, pWorkBlockHIndex, use_legacy_construction),
166
+ pWorkBlockHIndex->GetBlockHash (), response.mnListDiffH , errorRet)) {
165
167
return false ;
166
168
}
167
169
}
@@ -209,7 +211,9 @@ bool BuildQuorumRotationInfo(CDeterministicMNManager& dmnman, CQuorumSnapshotMan
209
211
// Checked later if extraShare is on
210
212
211
213
if (use_legacy_construction) {
212
- if (!BuildSimplifiedMNListDiff (dmnman, chainman, qblockman, qman, GetLastBaseBlockHash (baseBlockIndexes, pWorkBlockHMinusCIndex, use_legacy_construction), pWorkBlockHMinusCIndex->GetBlockHash (), response.mnListDiffAtHMinusC , errorRet)) {
214
+ if (!BuildSimplifiedMNListDiff (dmnman, chainman, qblockman, qman,
215
+ GetLastBaseBlockHash (baseBlockIndexes, pWorkBlockHMinusCIndex, use_legacy_construction),
216
+ pWorkBlockHMinusCIndex->GetBlockHash (), response.mnListDiffAtHMinusC , errorRet)) {
213
217
return false ;
214
218
}
215
219
}
@@ -223,7 +227,10 @@ bool BuildQuorumRotationInfo(CDeterministicMNManager& dmnman, CQuorumSnapshotMan
223
227
}
224
228
225
229
if (use_legacy_construction) {
226
- if (!BuildSimplifiedMNListDiff (dmnman, chainman, qblockman, qman, GetLastBaseBlockHash (baseBlockIndexes, pWorkBlockHMinus2CIndex, use_legacy_construction), pWorkBlockHMinus2CIndex->GetBlockHash (), response.mnListDiffAtHMinus2C , errorRet)) {
230
+ if (!BuildSimplifiedMNListDiff (dmnman, chainman, qblockman, qman,
231
+ GetLastBaseBlockHash (baseBlockIndexes, pWorkBlockHMinus2CIndex,
232
+ use_legacy_construction),
233
+ pWorkBlockHMinus2CIndex->GetBlockHash (), response.mnListDiffAtHMinus2C , errorRet)) {
227
234
return false ;
228
235
}
229
236
}
@@ -237,7 +244,10 @@ bool BuildQuorumRotationInfo(CDeterministicMNManager& dmnman, CQuorumSnapshotMan
237
244
}
238
245
239
246
if (use_legacy_construction) {
240
- if (!BuildSimplifiedMNListDiff (dmnman, chainman, qblockman, qman, GetLastBaseBlockHash (baseBlockIndexes, pWorkBlockHMinus3CIndex, use_legacy_construction), pWorkBlockHMinus3CIndex->GetBlockHash (), response.mnListDiffAtHMinus3C , errorRet)) {
247
+ if (!BuildSimplifiedMNListDiff (dmnman, chainman, qblockman, qman,
248
+ GetLastBaseBlockHash (baseBlockIndexes, pWorkBlockHMinus3CIndex,
249
+ use_legacy_construction),
250
+ pWorkBlockHMinus3CIndex->GetBlockHash (), response.mnListDiffAtHMinus3C , errorRet)) {
241
251
return false ;
242
252
}
243
253
}
@@ -267,7 +277,10 @@ bool BuildQuorumRotationInfo(CDeterministicMNManager& dmnman, CQuorumSnapshotMan
267
277
}
268
278
269
279
CSimplifiedMNListDiff mn4c;
270
- if (!BuildSimplifiedMNListDiff (dmnman, chainman, qblockman, qman, GetLastBaseBlockHash (baseBlockIndexes, pWorkBlockHMinus4CIndex, use_legacy_construction), pWorkBlockHMinus4CIndex->GetBlockHash (), mn4c, errorRet)) {
280
+ if (!BuildSimplifiedMNListDiff (dmnman, chainman, qblockman, qman,
281
+ GetLastBaseBlockHash (baseBlockIndexes, pWorkBlockHMinus4CIndex,
282
+ use_legacy_construction),
283
+ pWorkBlockHMinus4CIndex->GetBlockHash (), mn4c, errorRet)) {
271
284
return false ;
272
285
}
273
286
if (!use_legacy_construction) {
@@ -325,7 +338,9 @@ bool BuildQuorumRotationInfo(CDeterministicMNManager& dmnman, CQuorumSnapshotMan
325
338
}
326
339
327
340
CSimplifiedMNListDiff mnhneeded;
328
- if (!BuildSimplifiedMNListDiff (dmnman, chainman, qblockman, qman, GetLastBaseBlockHash (baseBlockIndexes, pNeededWorkBlockIndex, use_legacy_construction), pNeededWorkBlockIndex->GetBlockHash (), mnhneeded, errorRet)) {
341
+ if (!BuildSimplifiedMNListDiff (dmnman, chainman, qblockman, qman,
342
+ GetLastBaseBlockHash (baseBlockIndexes, pNeededWorkBlockIndex, use_legacy_construction),
343
+ pNeededWorkBlockIndex->GetBlockHash (), mnhneeded, errorRet)) {
329
344
return false ;
330
345
}
331
346
if (!use_legacy_construction) {
@@ -336,42 +351,46 @@ bool BuildQuorumRotationInfo(CDeterministicMNManager& dmnman, CQuorumSnapshotMan
336
351
337
352
if (!use_legacy_construction) {
338
353
if (!BuildSimplifiedMNListDiff (dmnman, chainman, qblockman, qman,
339
- GetLastBaseBlockHash (baseBlockIndexes, pWorkBlockHMinus3CIndex, use_legacy_construction),
354
+ GetLastBaseBlockHash (baseBlockIndexes, pWorkBlockHMinus3CIndex,
355
+ use_legacy_construction),
340
356
pWorkBlockHMinus3CIndex->GetBlockHash (), response.mnListDiffAtHMinus3C , errorRet)) {
341
357
return false ;
342
- }
358
+ }
343
359
baseBlockIndexes.push_back (pWorkBlockHMinus3CIndex);
344
360
345
361
if (!BuildSimplifiedMNListDiff (dmnman, chainman, qblockman, qman,
346
- GetLastBaseBlockHash (baseBlockIndexes, pWorkBlockHMinus2CIndex, use_legacy_construction),
362
+ GetLastBaseBlockHash (baseBlockIndexes, pWorkBlockHMinus2CIndex,
363
+ use_legacy_construction),
347
364
pWorkBlockHMinus2CIndex->GetBlockHash (), response.mnListDiffAtHMinus2C , errorRet)) {
348
365
return false ;
349
- }
366
+ }
350
367
baseBlockIndexes.push_back (pWorkBlockHMinus2CIndex);
351
368
352
369
if (!BuildSimplifiedMNListDiff (dmnman, chainman, qblockman, qman,
353
370
GetLastBaseBlockHash (baseBlockIndexes, pWorkBlockHMinusCIndex, use_legacy_construction),
354
371
pWorkBlockHMinusCIndex->GetBlockHash (), response.mnListDiffAtHMinusC , errorRet)) {
355
372
return false ;
356
- }
373
+ }
357
374
baseBlockIndexes.push_back (pWorkBlockHMinusCIndex);
358
375
359
376
if (!BuildSimplifiedMNListDiff (dmnman, chainman, qblockman, qman,
360
377
GetLastBaseBlockHash (baseBlockIndexes, pWorkBlockHIndex, use_legacy_construction),
361
378
pWorkBlockHIndex->GetBlockHash (), response.mnListDiffH , errorRet)) {
362
379
return false ;
363
- }
380
+ }
364
381
baseBlockIndexes.push_back (pWorkBlockHIndex);
365
382
366
- if (!BuildSimplifiedMNListDiff (dmnman, chainman, qblockman, qman, GetLastBaseBlockHash (baseBlockIndexes, tipBlockIndex, use_legacy_construction),
383
+ if (!BuildSimplifiedMNListDiff (dmnman, chainman, qblockman, qman,
384
+ GetLastBaseBlockHash (baseBlockIndexes, tipBlockIndex, use_legacy_construction),
367
385
tipBlockIndex->GetBlockHash (), response.mnListDiffTip , errorRet)) {
368
386
return false ;
369
- }
387
+ }
370
388
}
371
389
return true ;
372
390
}
373
391
374
- uint256 GetLastBaseBlockHash (Span<const CBlockIndex*> baseBlockIndexes, const CBlockIndex* blockIndex, bool use_legacy_construction)
392
+ uint256 GetLastBaseBlockHash (Span<const CBlockIndex*> baseBlockIndexes, const CBlockIndex* blockIndex,
393
+ bool use_legacy_construction)
375
394
{
376
395
uint256 hash;
377
396
if (!use_legacy_construction) {
0 commit comments