Skip to content

Commit 6f72dc6

Browse files
authored
Updated Dogecoin and Litecoin network params (#51)
* set segwitAddressHrp to Litecoin and Dogecoin network params * updated litecoin protocol version to handle witnesses * updated p2sh header for ltc main and test net * Correct Dogecoin testnet address prefix Authored-by: Wasiq Nazir <[email protected]>
1 parent e213af7 commit 6f72dc6

File tree

5 files changed

+7
-3
lines changed

5 files changed

+7
-3
lines changed

core/src/main/java/org/libdohj/params/AbstractLitecoinParams.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public abstract class AbstractLitecoinParams extends NetworkParameters implement
7676
public static final String ID_LITE_REGTEST = "regtest";
7777

7878
public static final int LITECOIN_PROTOCOL_VERSION_MINIMUM = 70002;
79-
public static final int LITECOIN_PROTOCOL_VERSION_CURRENT = 70003;
79+
public static final int LITECOIN_PROTOCOL_VERSION_CURRENT = 70012;
8080

8181
private static final Coin BASE_SUBSIDY = COIN.multiply(50);
8282

core/src/main/java/org/libdohj/params/DogecoinMainNetParams.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public DogecoinMainNetParams() {
3737
p2shHeader = 22;
3838
port = 22556;
3939
packetMagic = 0xc0c0c0c0;
40+
segwitAddressHrp = "doge";
4041
// Note that while BIP44 makes HD wallets chain-agnostic, for legacy
4142
// reasons we use a Doge-specific header for main net. At some point
4243
// we'll add independent headers for BIP32 legacy and BIP44.

core/src/main/java/org/libdohj/params/DogecoinTestNet3Params.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public DogecoinTestNet3Params() {
4444
addressHeader = 113;
4545
p2shHeader = 196;
4646
dumpedPrivateKeyHeader = 241;
47+
segwitAddressHrp = "tdge";
4748
genesisBlock.setTime(1391503289L);
4849
genesisBlock.setDifficultyTarget(0x1e0ffff0L);
4950
genesisBlock.setNonce(997879);

core/src/main/java/org/libdohj/params/LitecoinMainNetParams.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ public LitecoinMainNetParams() {
5151
maxTarget = Utils.decodeCompactBits(0x1e0fffffL);
5252
port = 9333;
5353
addressHeader = 48;
54-
p2shHeader = 5;
54+
p2shHeader = 50;
5555
dumpedPrivateKeyHeader = 176;
56+
segwitAddressHrp = "ltc";
5657

5758
this.genesisBlock = createGenesis(this);
5859
spendableCoinbaseDepth = 100;

core/src/main/java/org/libdohj/params/LitecoinTestNet3Params.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ public LitecoinTestNet3Params() {
5151
maxTarget = Utils.decodeCompactBits(0x1e0fffffL);
5252
port = 19333;
5353
addressHeader = 111;
54-
p2shHeader = 196;
54+
p2shHeader = 58;
5555
dumpedPrivateKeyHeader = 239;
56+
segwitAddressHrp = "tltc";
5657

5758
this.genesisBlock = createGenesis(this);
5859
spendableCoinbaseDepth = 30;

0 commit comments

Comments
 (0)