mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-11-03 14:07:14 +00:00
Fix height in large-reorg test
This commit is contained in:
@@ -1632,7 +1632,7 @@ public class FullBlockTestGenerator {
|
|||||||
new TransactionOutPoint(params, 0, b1001.getTransactions().get(0).getHash()),
|
new TransactionOutPoint(params, 0, b1001.getTransactions().get(0).getHash()),
|
||||||
b1001.getTransactions().get(0).getOutputs().get(0).getValue(),
|
b1001.getTransactions().get(0).getOutputs().get(0).getValue(),
|
||||||
b1001.getTransactions().get(0).getOutputs().get(0).getScriptPubKey()));
|
b1001.getTransactions().get(0).getOutputs().get(0).getScriptPubKey()));
|
||||||
int nextHeight = chainHeadHeight + 31;
|
int heightAfter1001 = chainHeadHeight + 31;
|
||||||
|
|
||||||
if (runLargeReorgs) {
|
if (runLargeReorgs) {
|
||||||
// No way you can fit this test in memory
|
// No way you can fit this test in memory
|
||||||
@@ -1641,6 +1641,7 @@ public class FullBlockTestGenerator {
|
|||||||
Block lastBlock = b1001;
|
Block lastBlock = b1001;
|
||||||
TransactionOutPoint lastOutput = new TransactionOutPoint(params, 2, b1001.getTransactions().get(1).getHash());
|
TransactionOutPoint lastOutput = new TransactionOutPoint(params, 2, b1001.getTransactions().get(1).getHash());
|
||||||
int blockCountAfter1001;
|
int blockCountAfter1001;
|
||||||
|
int nextHeight = heightAfter1001;
|
||||||
|
|
||||||
List<Sha256Hash> hashesToSpend = new LinkedList<Sha256Hash>(); // all index 0
|
List<Sha256Hash> hashesToSpend = new LinkedList<Sha256Hash>(); // all index 0
|
||||||
final int TRANSACTION_CREATION_BLOCKS = 100;
|
final int TRANSACTION_CREATION_BLOCKS = 100;
|
||||||
@@ -1679,7 +1680,7 @@ public class FullBlockTestGenerator {
|
|||||||
// Reorg back to b1001 + empty blocks
|
// Reorg back to b1001 + empty blocks
|
||||||
Sha256Hash firstHash = lastBlock.getHash();
|
Sha256Hash firstHash = lastBlock.getHash();
|
||||||
int height = nextHeight-1;
|
int height = nextHeight-1;
|
||||||
nextHeight = chainHeadHeight + 26;
|
nextHeight = heightAfter1001;
|
||||||
lastBlock = b1001;
|
lastBlock = b1001;
|
||||||
for (int i = 0; i < blockCountAfter1001; i++) {
|
for (int i = 0; i < blockCountAfter1001; i++) {
|
||||||
Block block = createNextBlock(lastBlock, nextHeight++, null, null);
|
Block block = createNextBlock(lastBlock, nextHeight++, null, null);
|
||||||
|
|||||||
Reference in New Issue
Block a user