mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-11 17:55:53 +00:00
Construct the AltcoinBlock differently, because setMerkleRoot() is private.
This commit is contained in:
parent
99249bfdb7
commit
02e0d3dc53
@ -29,6 +29,7 @@ import org.bitcoinj.script.ScriptOpCodes;
|
|||||||
import org.bouncycastle.util.encoders.Hex;
|
import org.bouncycastle.util.encoders.Hex;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
import static com.google.common.base.Preconditions.checkState;
|
import static com.google.common.base.Preconditions.checkState;
|
||||||
|
|
||||||
@ -83,7 +84,6 @@ public class DigibyteMainNetParams extends AbstractDigibyteParams {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static AltcoinBlock createGenesis(NetworkParameters params) {
|
private static AltcoinBlock createGenesis(NetworkParameters params) {
|
||||||
AltcoinBlock genesisBlock = new AltcoinBlock(params, Block.BLOCK_VERSION_GENESIS);
|
|
||||||
Transaction t = new Transaction(params);
|
Transaction t = new Transaction(params);
|
||||||
try {
|
try {
|
||||||
// A script containing the difficulty bits and the following message:
|
// A script containing the difficulty bits and the following message:
|
||||||
@ -101,10 +101,11 @@ public class DigibyteMainNetParams extends AbstractDigibyteParams {
|
|||||||
// Cannot happen.
|
// Cannot happen.
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
genesisBlock.addTransaction(t);
|
|
||||||
genesisBlock.setTime(1389388394L);
|
Sha256Hash merkleRoot = Sha256Hash.wrap("72ddd9496b004221ed0557358846d9248ecd4c440ebd28ed901efc18757d0fad");
|
||||||
genesisBlock.setDifficultyTarget(0x1e0ffff0L);
|
AltcoinBlock genesisBlock = new AltcoinBlock(params, Block.BLOCK_VERSION_GENESIS, Sha256Hash.ZERO_HASH,
|
||||||
genesisBlock.setNonce(2447652);
|
merkleRoot, 1389388394L, 0x1e0ffff0L, 2447652, Arrays.asList(t));
|
||||||
|
|
||||||
return genesisBlock;
|
return genesisBlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user