Commit c310c6ba authored by bitcoinj-sv's avatar bitcoinj-sv

fixed bitcoinj-cash spv

parent 08fe07b6
...@@ -65,7 +65,7 @@ public class Block extends Message { ...@@ -65,7 +65,7 @@ public class Block extends Message {
* upgrade everyone to change this, so Bitcoin can continue to grow. For now it exists as an anti-DoS measure to * upgrade everyone to change this, so Bitcoin can continue to grow. For now it exists as an anti-DoS measure to
* avoid somebody creating a titanically huge but valid block and forcing everyone to download/store it forever. * avoid somebody creating a titanically huge but valid block and forcing everyone to download/store it forever.
*/ */
public static final int MAX_BLOCK_SIZE = 1 * 1000 * 1000; public static final int MAX_BLOCK_SIZE = 128 * 1000 * 1000;
/** /**
* A "sigop" is a signature verification operation. Because they're expensive we also impose a separate limit on * A "sigop" is a signature verification operation. Because they're expensive we also impose a separate limit on
* the number in a block to prevent somebody mining a huge block that has way more sigops than normal, so is very * the number in a block to prevent somebody mining a huge block that has way more sigops than normal, so is very
......
...@@ -123,6 +123,7 @@ public abstract class NetworkParameters { ...@@ -123,6 +123,7 @@ public abstract class NetworkParameters {
private static Block createGenesis(NetworkParameters n) { private static Block createGenesis(NetworkParameters n) {
Block genesisBlock = new Block(n, Block.BLOCK_VERSION_GENESIS); Block genesisBlock = new Block(n, Block.BLOCK_VERSION_GENESIS);
Transaction t = new Transaction(n); Transaction t = new Transaction(n);
t.setVersion(1);
try { try {
// A script containing the difficulty bits and the following message: // A script containing the difficulty bits and the following message:
// //
...@@ -538,8 +539,7 @@ public abstract class NetworkParameters { ...@@ -538,8 +539,7 @@ public abstract class NetworkParameters {
return verifyFlags; return verifyFlags;
} }
public void verifyDifficulty(BigInteger newTarget, Block nextBlock) public void verifyDifficulty(BigInteger newTarget, Block nextBlock) {
{
if (newTarget.compareTo(this.getMaxTarget()) > 0) { if (newTarget.compareTo(this.getMaxTarget()) > 0) {
newTarget = this.getMaxTarget(); newTarget = this.getMaxTarget();
} }
......
...@@ -565,7 +565,7 @@ public class Peer extends PeerSocketHandler { ...@@ -565,7 +565,7 @@ public class Peer extends PeerSocketHandler {
return; return;
} }
if ((vPeerVersionMessage.localServices if ((vPeerVersionMessage.localServices
& VersionMessage.NODE_BITCOIN_CASH) == VersionMessage.NODE_BITCOIN_CASH) { & VersionMessage.NODE_BITCOIN_CASH) != VersionMessage.NODE_BITCOIN_CASH) {
log.info("{}: Peer follows an incompatible block chain.", this); log.info("{}: Peer follows an incompatible block chain.", this);
// Shut down the channel gracefully. // Shut down the channel gracefully.
close(); close();
......
...@@ -42,7 +42,7 @@ public class MainNetParams extends AbstractBitcoinNetParams { ...@@ -42,7 +42,7 @@ public class MainNetParams extends AbstractBitcoinNetParams {
p2shHeader = 5; p2shHeader = 5;
acceptableAddressCodes = new int[] { addressHeader, p2shHeader }; acceptableAddressCodes = new int[] { addressHeader, p2shHeader };
port = 8333; port = 8333;
packetMagic = 0xf9beb4d9L; packetMagic = 0xe3e1f3e8L;
bip32HeaderPub = 0x0488B21E; //The 4 byte header that serializes in base58 to "xpub". bip32HeaderPub = 0x0488B21E; //The 4 byte header that serializes in base58 to "xpub".
bip32HeaderPriv = 0x0488ADE4; //The 4 byte header that serializes in base58 to "xprv" bip32HeaderPriv = 0x0488ADE4; //The 4 byte header that serializes in base58 to "xprv"
...@@ -69,6 +69,7 @@ public class MainNetParams extends AbstractBitcoinNetParams { ...@@ -69,6 +69,7 @@ public class MainNetParams extends AbstractBitcoinNetParams {
checkpoints.put(91842, Sha256Hash.wrap("00000000000a4d0a398161ffc163c503763b1f4360639393e0e4c8e300e0caec")); checkpoints.put(91842, Sha256Hash.wrap("00000000000a4d0a398161ffc163c503763b1f4360639393e0e4c8e300e0caec"));
checkpoints.put(91880, Sha256Hash.wrap("00000000000743f190a18c5577a3c2d2a1f610ae9601ac046a38084ccb7cd721")); checkpoints.put(91880, Sha256Hash.wrap("00000000000743f190a18c5577a3c2d2a1f610ae9601ac046a38084ccb7cd721"));
checkpoints.put(200000, Sha256Hash.wrap("000000000000034a7dedef4a161fa058a2d67a173a90155f3a2fe6fc132e0ebf")); checkpoints.put(200000, Sha256Hash.wrap("000000000000034a7dedef4a161fa058a2d67a173a90155f3a2fe6fc132e0ebf"));
checkpoints.put(478559, Sha256Hash.wrap("000000000000000000651ef99cb9fcbe0dadde1d424bd9f15ff20136191a5eec"));
dnsSeeds = new String[] { dnsSeeds = new String[] {
"seed.bitcoinsv.io", // Bitcoin SV seeder "seed.bitcoinsv.io", // Bitcoin SV seeder
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment