mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-11-01 21:17:13 +00:00
fix peer monitor
This commit is contained in:
@@ -82,7 +82,7 @@ public final class Coin implements Monetary, Comparable<Coin>, Serializable {
|
|||||||
*/
|
*/
|
||||||
public final long value;
|
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) {
|
private Coin(final long satoshis) {
|
||||||
checkArgument(-MAX_SATOSHIS <= satoshis && satoshis <= MAX_SATOSHIS,
|
checkArgument(-MAX_SATOSHIS <= satoshis && satoshis <= MAX_SATOSHIS,
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import com.dogecoin.dogecoinj.params.*;
|
|||||||
import com.dogecoin.dogecoinj.script.Script;
|
import com.dogecoin.dogecoinj.script.Script;
|
||||||
import com.dogecoin.dogecoinj.script.ScriptOpCodes;
|
import com.dogecoin.dogecoinj.script.ScriptOpCodes;
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
|
import com.google.common.math.LongMath;
|
||||||
import org.spongycastle.util.encoders.Hex;
|
import org.spongycastle.util.encoders.Hex;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
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.
|
* This is 92bn! We don't expect single transactions or blocks with that value.
|
||||||
* Therefore we can assume this will suffice.
|
* 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
|
* 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. */
|
/** Alias for TestNet3Params.get(), use that instead. */
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
|||||||
@@ -75,7 +75,6 @@ public class MainNetParams extends NetworkParameters {
|
|||||||
dnsSeeds = new String[] {
|
dnsSeeds = new String[] {
|
||||||
"seed.dogecoin.com",
|
"seed.dogecoin.com",
|
||||||
"seed.mophides.com",
|
"seed.mophides.com",
|
||||||
"seed.dglibrary.org",
|
|
||||||
"seed.dogechain.info",
|
"seed.dogechain.info",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,8 @@ public class PeerMonitor {
|
|||||||
params = MainNetParams.get();
|
params = MainNetParams.get();
|
||||||
peerGroup = new PeerGroup(params, null /* no chain */);
|
peerGroup = new PeerGroup(params, null /* no chain */);
|
||||||
peerGroup.setUserAgent("PeerMonitor", "1.0");
|
peerGroup.setUserAgent("PeerMonitor", "1.0");
|
||||||
peerGroup.setMaxConnections(4);
|
peerGroup.setUseLocalhostPeerWhenPossible(false);
|
||||||
|
peerGroup.setMaxConnections(15);
|
||||||
peerGroup.addPeerDiscovery(new DnsDiscovery(params));
|
peerGroup.addPeerDiscovery(new DnsDiscovery(params));
|
||||||
peerGroup.addEventListener(new AbstractPeerEventListener() {
|
peerGroup.addEventListener(new AbstractPeerEventListener() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user