mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-01-31 15:22:16 +00:00
Fix b61 creation (why was it written this way in the first place?)
This commit is contained in:
parent
f2678463be
commit
5304a55d86
@ -1117,16 +1117,9 @@ public class FullBlockTestGenerator {
|
||||
|
||||
Block b61 = createNextBlock(b60, chainHeadHeight + 19, out18, null);
|
||||
{
|
||||
final Transaction tx = b61.getTransactions().get(0);
|
||||
byte[] scriptBytes = tx.getInputs().get(0).getScriptBytes();
|
||||
// createNextBlock will increment a uint16 in the first script bytes of each new block.
|
||||
int tmp = (scriptBytes[0] | (scriptBytes[1] << 8)) - 1;
|
||||
scriptBytes[0] = (byte) tmp;
|
||||
scriptBytes[1] = (byte) (tmp >> 8);
|
||||
tx.getInputs().get(0).setScriptBytes(scriptBytes);
|
||||
b61.getTransactions().get(0).getInput(0).setScriptBytes(b60.getTransactions().get(0).getInput(0).getScriptBytes());
|
||||
b61.unCache();
|
||||
final Transaction tx2 = b60.getTransactions().get(0);
|
||||
Preconditions.checkState(tx.equals(tx2));
|
||||
Preconditions.checkState(b61.getTransactions().get(0).equals(b60.getTransactions().get(0)));
|
||||
}
|
||||
b61.solve();
|
||||
blocks.add(new BlockAndValidity(blockToHeightMap, b61, false, true, b60.getHash(), chainHeadHeight + 18, "b61"));
|
||||
|
Loading…
Reference in New Issue
Block a user