diff --git a/core/src/main/java/com/dogecoin/dogecoinj/core/Coin.java b/core/src/main/java/com/dogecoin/dogecoinj/core/Coin.java index c7bc06b7..e6e34b24 100644 --- a/core/src/main/java/com/dogecoin/dogecoinj/core/Coin.java +++ b/core/src/main/java/com/dogecoin/dogecoinj/core/Coin.java @@ -82,7 +82,7 @@ public final class Coin implements Monetary, Comparable, Serializable { */ public final long value; - private final long MAX_SATOSHIS = COIN_VALUE * NetworkParameters.MAX_COINS; + private final long MAX_SATOSHIS = Long.MAX_VALUE; private Coin(final long satoshis) { checkArgument(-MAX_SATOSHIS <= satoshis && satoshis <= MAX_SATOSHIS, diff --git a/core/src/main/java/com/dogecoin/dogecoinj/core/NetworkParameters.java b/core/src/main/java/com/dogecoin/dogecoinj/core/NetworkParameters.java index c5a89dcf..a116cb38 100644 --- a/core/src/main/java/com/dogecoin/dogecoinj/core/NetworkParameters.java +++ b/core/src/main/java/com/dogecoin/dogecoinj/core/NetworkParameters.java @@ -21,6 +21,7 @@ import com.dogecoin.dogecoinj.params.*; import com.dogecoin.dogecoinj.script.Script; import com.dogecoin.dogecoinj.script.ScriptOpCodes; import com.google.common.base.Objects; +import com.google.common.math.LongMath; import org.spongycastle.util.encoders.Hex; import javax.annotation.Nullable; @@ -142,12 +143,12 @@ public abstract class NetworkParameters implements Serializable { * This is 92bn! We don't expect single transactions or blocks with that value. * Therefore we can assume this will suffice. */ - public static final long MAX_COINS = Long.MAX_VALUE / Coin.SMALLEST_UNIT_EXPONENT; + public static final long MAX_COINS = Long.MAX_VALUE / LongMath.pow(10, Coin.SMALLEST_UNIT_EXPONENT); /** * The maximum money to be generated */ - public static final Coin MAX_MONEY = COIN.multiply(MAX_COINS); + public static final Coin MAX_MONEY = Coin.valueOf(Long.MAX_VALUE); /** Alias for TestNet3Params.get(), use that instead. */ @Deprecated diff --git a/core/src/main/java/com/dogecoin/dogecoinj/params/MainNetParams.java b/core/src/main/java/com/dogecoin/dogecoinj/params/MainNetParams.java index 65bfdec1..de07304e 100644 --- a/core/src/main/java/com/dogecoin/dogecoinj/params/MainNetParams.java +++ b/core/src/main/java/com/dogecoin/dogecoinj/params/MainNetParams.java @@ -75,7 +75,6 @@ public class MainNetParams extends NetworkParameters { dnsSeeds = new String[] { "seed.dogecoin.com", "seed.mophides.com", - "seed.dglibrary.org", "seed.dogechain.info", }; } diff --git a/examples/src/main/java/com/dogecoin/dogecoinj/examples/PeerMonitor.java b/examples/src/main/java/com/dogecoin/dogecoinj/examples/PeerMonitor.java index 5ce976a0..4d3503f1 100644 --- a/examples/src/main/java/com/dogecoin/dogecoinj/examples/PeerMonitor.java +++ b/examples/src/main/java/com/dogecoin/dogecoinj/examples/PeerMonitor.java @@ -65,7 +65,8 @@ public class PeerMonitor { params = MainNetParams.get(); peerGroup = new PeerGroup(params, null /* no chain */); peerGroup.setUserAgent("PeerMonitor", "1.0"); - peerGroup.setMaxConnections(4); + peerGroup.setUseLocalhostPeerWhenPossible(false); + peerGroup.setMaxConnections(15); peerGroup.addPeerDiscovery(new DnsDiscovery(params)); peerGroup.addEventListener(new AbstractPeerEventListener() { @Override