3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-01-30 23:02:15 +00:00

Fix height in large-reorg test

This commit is contained in:
Matt Corallo 2013-10-27 02:01:27 -04:00 committed by Mike Hearn
parent 8284e1cfbc
commit 2780b3f9b7

View File

@ -1632,7 +1632,7 @@ public class FullBlockTestGenerator {
new TransactionOutPoint(params, 0, b1001.getTransactions().get(0).getHash()),
b1001.getTransactions().get(0).getOutputs().get(0).getValue(),
b1001.getTransactions().get(0).getOutputs().get(0).getScriptPubKey()));
int nextHeight = chainHeadHeight + 31;
int heightAfter1001 = chainHeadHeight + 31;
if (runLargeReorgs) {
// No way you can fit this test in memory
@ -1641,6 +1641,7 @@ public class FullBlockTestGenerator {
Block lastBlock = b1001;
TransactionOutPoint lastOutput = new TransactionOutPoint(params, 2, b1001.getTransactions().get(1).getHash());
int blockCountAfter1001;
int nextHeight = heightAfter1001;
List<Sha256Hash> hashesToSpend = new LinkedList<Sha256Hash>(); // all index 0
final int TRANSACTION_CREATION_BLOCKS = 100;
@ -1679,7 +1680,7 @@ public class FullBlockTestGenerator {
// Reorg back to b1001 + empty blocks
Sha256Hash firstHash = lastBlock.getHash();
int height = nextHeight-1;
nextHeight = chainHeadHeight + 26;
nextHeight = heightAfter1001;
lastBlock = b1001;
for (int i = 0; i < blockCountAfter1001; i++) {
Block block = createNextBlock(lastBlock, nextHeight++, null, null);