本文整理汇总了Java中com.google.bitcoin.core.CoinDefinition类的典型用法代码示例。如果您正苦于以下问题:Java CoinDefinition类的具体用法?Java CoinDefinition怎么用?Java CoinDefinition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CoinDefinition类属于com.google.bitcoin.core包,在下文中一共展示了CoinDefinition类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: UnitTestParams
import com.google.bitcoin.core.CoinDefinition; //导入依赖的package包/类
public UnitTestParams() {
super();
id = ID_UNITTESTNET;
packetMagic = 0x0b110907;
addressHeader = CoinDefinition.testnetAddressHeader;
p2shHeader = CoinDefinition.testnetp2shHeader;
acceptableAddressCodes = new int[] { addressHeader, p2shHeader };
proofOfWorkLimit = new BigInteger("00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 16);
genesisBlock.setTime(System.currentTimeMillis() / 1000);
genesisBlock.setDifficultyTarget(Block.EASIEST_DIFFICULTY_TARGET);
genesisBlock.solve();
port = CoinDefinition.TestPort;
interval = 10;
dumpedPrivateKeyHeader = 128 + CoinDefinition.testnetAddressHeader;
targetTimespan = 200000000; // 6 years. Just a very big number.
spendableCoinbaseDepth = 5;
subsidyDecreaseBlockCount = 100;
dnsSeeds = null;
}
开发者ID:HashEngineering,项目名称:megacoinj,代码行数:20,代码来源:UnitTestParams.java
示例2: TestNet2Params
import com.google.bitcoin.core.CoinDefinition; //导入依赖的package包/类
public TestNet2Params() {
super();
id = ID_TESTNET;
packetMagic = 0xfabfb5daL;
port = CoinDefinition.TestPort;
addressHeader = CoinDefinition.testnetAddressHeader;
p2shHeader = CoinDefinition.testnetp2shHeader;
acceptableAddressCodes = new int[] { addressHeader, p2shHeader };
interval = INTERVAL;
targetTimespan = TARGET_TIMESPAN;
proofOfWorkLimit = CoinDefinition.proofOfWorkLimit;
dumpedPrivateKeyHeader = 128 + CoinDefinition.testnetAddressHeader;
genesisBlock.setTime(1296688602L);
genesisBlock.setDifficultyTarget(0x1d07fff8L);
genesisBlock.setNonce(384568319);
spendableCoinbaseDepth = CoinDefinition.spendableCoinbaseDepth;
subsidyDecreaseBlockCount = CoinDefinition.subsidyDecreaseBlockCount;
String genesisHash = genesisBlock.getHashAsString();
//checkState(genesisHash.equals("00000007199508e34a9ff81e6ec0c477a4cccff2a4767a8eee39c11db367b008"));
dnsSeeds = null;
}
开发者ID:HashEngineering,项目名称:megacoinj,代码行数:24,代码来源:TestNet2Params.java
示例3: TestNet2Params
import com.google.bitcoin.core.CoinDefinition; //导入依赖的package包/类
public TestNet2Params() {
super();
id = ID_TESTNET;
packetMagic = 0xfabfb5daL;
port = CoinDefinition.TestPort;
addressHeader = CoinDefinition.testnetAddressHeader;
p2shHeader = CoinDefinition.testnetp2shHeader;
acceptableAddressCodes = new int[] { addressHeader, p2shHeader };
interval = INTERVAL;
targetTimespan = TARGET_TIMESPAN;
proofOfWorkLimit = CoinDefinition.proofOfWorkLimit;
dumpedPrivateKeyHeader = 128 + CoinDefinition.testnetAddressHeader;
genesisBlock.setTime(1296688602L);
genesisBlock.setDifficultyTarget(0x1d07fff8L);
genesisBlock.setNonce(384568319);
spendableCoinbaseDepth = CoinDefinition.spendableCoinbaseDepth;
subsidyDecreaseBlockCount = CoinDefinition.subsidyDecreaseBlockCount;
String genesisHash = genesisBlock.getHashAsString();
checkState(genesisHash.equals("00000007199508e34a9ff81e6ec0c477a4cccff2a4767a8eee39c11db367b008"));
dnsSeeds = null;
}
开发者ID:9cat,项目名称:templecoin-java,代码行数:24,代码来源:TestNet2Params.java
示例4: writeKeys
import com.google.bitcoin.core.CoinDefinition; //导入依赖的package包/类
public static void writeKeys(@Nonnull final Writer out, @Nonnull final List<ECKey> keys) throws IOException
{
final DateFormat format = Iso8601Format.newDateTimeFormatT();
out.write("# KEEP YOUR PRIVATE KEYS SAFE! Anyone who can read this can spend your "+ CoinDefinition.coinName+"s.\n");
for (final ECKey key : keys)
{
out.write(key.getPrivateKeyEncoded(Constants.NETWORK_PARAMETERS).toString());
if (key.getCreationTimeSeconds() != 0)
{
out.write(' ');
out.write(format.format(new Date(key.getCreationTimeSeconds() * DateUtils.SECOND_IN_MILLIS)));
}
out.write('\n');
}
}
开发者ID:9cat,项目名称:templecoin-android-wallet,代码行数:18,代码来源:WalletUtils.java
示例5: TestNet3Params
import com.google.bitcoin.core.CoinDefinition; //导入依赖的package包/类
public TestNet3Params() {
super();
id = ID_TESTNET;
// Genesis hash is 000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943
packetMagic = 0x0b110907;
interval = INTERVAL;
targetTimespan = TARGET_TIMESPAN;
proofOfWorkLimit = Utils.decodeCompactBits(0x1d00ffffL);
port = 18333;
addressHeader = CoinDefinition.testnetAddressHeader;
p2shHeader = CoinDefinition.testnetp2shHeader;
acceptableAddressCodes = new int[] { addressHeader, p2shHeader };
dumpedPrivateKeyHeader = 128 + CoinDefinition.testnetAddressHeader;
genesisBlock.setTime(CoinDefinition.testnetGenesisBlockTime);
genesisBlock.setDifficultyTarget(CoinDefinition.testnetGenesisBlockDifficultyTarget);
genesisBlock.setNonce(CoinDefinition.testnetGenesisBlockNonce);
spendableCoinbaseDepth = 100;
subsidyDecreaseBlockCount = CoinDefinition.subsidyDecreaseBlockCount;
String genesisHash = genesisBlock.getHashAsString();
if(CoinDefinition.supportsTestNet)
checkState(genesisHash.equals(CoinDefinition.testnetGenesisHash));
alertSigningKey = Hex.decode(CoinDefinition.TESTNET_SATOSHI_KEY);
dnsSeeds = CoinDefinition.dnsSeeds;
}
开发者ID:HashEngineering,项目名称:megacoinj,代码行数:29,代码来源:TestNet3Params.java
示例6: MainNetParams
import com.google.bitcoin.core.CoinDefinition; //导入依赖的package包/类
public MainNetParams() {
super();
interval = INTERVAL;
targetTimespan = TARGET_TIMESPAN;
proofOfWorkLimit = CoinDefinition.proofOfWorkLimit;
dumpedPrivateKeyHeader = 128 + CoinDefinition.AddressHeader;
addressHeader = CoinDefinition.AddressHeader;
p2shHeader = CoinDefinition.p2shHeader;
acceptableAddressCodes = new int[] { addressHeader, p2shHeader};
port = CoinDefinition.Port;
packetMagic = CoinDefinition.PacketMagic;
genesisBlock.setDifficultyTarget(CoinDefinition.genesisBlockDifficultyTarget);
genesisBlock.setTime(CoinDefinition.genesisBlockTime);
genesisBlock.setNonce(CoinDefinition.genesisBlockNonce);
id = ID_MAINNET;
subsidyDecreaseBlockCount = CoinDefinition.subsidyDecreaseBlockCount;
spendableCoinbaseDepth = CoinDefinition.spendableCoinbaseDepth;
String genesisHash = genesisBlock.getHashAsString();
checkState(genesisHash.equals(CoinDefinition.genesisHash),
genesisHash);
CoinDefinition.initCheckpoints(checkpoints);
dnsSeeds = CoinDefinition.dnsSeeds;
}
开发者ID:HashEngineering,项目名称:megacoinj,代码行数:28,代码来源:MainNetParams.java
示例7: testConvertToBitcoinURI
import com.google.bitcoin.core.CoinDefinition; //导入依赖的package包/类
@Test
public void testConvertToBitcoinURI() throws Exception {
Address goodAddress = new Address(MainNetParams.get(), MAINNET_GOOD_ADDRESS);
// simple example
assertEquals(CoinDefinition.coinURIScheme + ":" + MAINNET_GOOD_ADDRESS + "?amount=12.34&label=Hello&message=AMessage", BitcoinURI.convertToBitcoinURI(goodAddress, Utils.toNanoCoins("12.34"), "Hello", "AMessage"));
// example with spaces, ampersand and plus
assertEquals(CoinDefinition.coinURIScheme + ":" + MAINNET_GOOD_ADDRESS + "?amount=12.34&label=Hello%20World&message=Mess%20%26%20age%20%2B%20hope", BitcoinURI.convertToBitcoinURI(goodAddress, Utils.toNanoCoins("12.34"), "Hello World", "Mess & age + hope"));
// no amount, label present, message present
assertEquals(CoinDefinition.coinURIScheme + ":" + MAINNET_GOOD_ADDRESS + "?label=Hello&message=glory", BitcoinURI.convertToBitcoinURI(goodAddress, null, "Hello", "glory"));
// amount present, no label, message present
assertEquals(CoinDefinition.coinURIScheme + ":" + MAINNET_GOOD_ADDRESS + "?amount=0.1&message=glory", BitcoinURI.convertToBitcoinURI(goodAddress, Utils.toNanoCoins("0.1"), null, "glory"));
assertEquals(CoinDefinition.coinURIScheme + ":" + MAINNET_GOOD_ADDRESS + "?amount=0.1&message=glory", BitcoinURI.convertToBitcoinURI(goodAddress, Utils.toNanoCoins("0.1"), "", "glory"));
// amount present, label present, no message
assertEquals(CoinDefinition.coinURIScheme + ":" + MAINNET_GOOD_ADDRESS + "?amount=12.34&label=Hello", BitcoinURI.convertToBitcoinURI(goodAddress, Utils.toNanoCoins("12.34"), "Hello", null));
assertEquals(CoinDefinition.coinURIScheme + ":" + MAINNET_GOOD_ADDRESS + "?amount=12.34&label=Hello", BitcoinURI.convertToBitcoinURI(goodAddress, Utils.toNanoCoins("12.34"), "Hello", ""));
// amount present, no label, no message
assertEquals(CoinDefinition.coinURIScheme + ":" + MAINNET_GOOD_ADDRESS + "?amount=1000", BitcoinURI.convertToBitcoinURI(goodAddress, Utils.toNanoCoins("1000"), null, null));
assertEquals(CoinDefinition.coinURIScheme + ":" + MAINNET_GOOD_ADDRESS + "?amount=1000", BitcoinURI.convertToBitcoinURI(goodAddress, Utils.toNanoCoins("1000"), "", ""));
// no amount, label present, no message
assertEquals(CoinDefinition.coinURIScheme + ":" + MAINNET_GOOD_ADDRESS + "?label=Hello", BitcoinURI.convertToBitcoinURI(goodAddress, null, "Hello", null));
// no amount, no label, message present
assertEquals(CoinDefinition.coinURIScheme + ":" + MAINNET_GOOD_ADDRESS + "?message=Agatha", BitcoinURI.convertToBitcoinURI(goodAddress, null, null, "Agatha"));
assertEquals(CoinDefinition.coinURIScheme + ":" + MAINNET_GOOD_ADDRESS + "?message=Agatha", BitcoinURI.convertToBitcoinURI(goodAddress, null, "", "Agatha"));
// no amount, no label, no message
assertEquals(CoinDefinition.coinURIScheme + ":" + MAINNET_GOOD_ADDRESS, BitcoinURI.convertToBitcoinURI(goodAddress, null, null, null));
assertEquals(CoinDefinition.coinURIScheme + ":" + MAINNET_GOOD_ADDRESS, BitcoinURI.convertToBitcoinURI(goodAddress, null, "", ""));
}
开发者ID:HashEngineering,项目名称:megacoinj,代码行数:37,代码来源:BitcoinURITest.java
示例8: testGood_Combinations
import com.google.bitcoin.core.CoinDefinition; //导入依赖的package包/类
/**
* Handles various well-formed combinations
*
* @throws BitcoinURIParseException
* If something goes wrong
*/
@Test
public void testGood_Combinations() throws BitcoinURIParseException {
testObject = new BitcoinURI(MainNetParams.get(), BitcoinURI.BITCOIN_SCHEME + ":" + MAINNET_GOOD_ADDRESS
+ "?amount=6543210&label=Hello%20World&message=Be%20well");
assertEquals(
"BitcoinURI['amount'='654321000000000','label'='Hello World','message'='Be well','address'='"+CoinDefinition.UNITTEST_ADDRESS+"']",
testObject.toString());
}
开发者ID:HashEngineering,项目名称:megacoinj,代码行数:15,代码来源:BitcoinURITest.java
示例9: brokenURIs
import com.google.bitcoin.core.CoinDefinition; //导入依赖的package包/类
@Test
public void brokenURIs() throws BitcoinURIParseException {
// Check we can parse the incorrectly formatted URIs produced by blockchain.info and its iPhone app.
String str = CoinDefinition.coinURIScheme + "://"+CoinDefinition.UNITTEST_ADDRESS+"?amount=0.01000000";
BitcoinURI uri = new BitcoinURI(str);
assertEquals(CoinDefinition.UNITTEST_ADDRESS, uri.getAddress().toString());
assertEquals(Utils.toNanoCoins(0, 1), uri.getAmount());
}
开发者ID:HashEngineering,项目名称:megacoinj,代码行数:9,代码来源:BitcoinURITest.java
示例10: testPaymentProtocolReq
import com.google.bitcoin.core.CoinDefinition; //导入依赖的package包/类
@Test
public void testPaymentProtocolReq() throws Exception {
// Non-backwards compatible form ...
BitcoinURI uri = new BitcoinURI(TestNet3Params.get(), CoinDefinition.coinURIScheme + ":?r=https%3A%2F%2Fbitcoincore.org%2F%7Egavin%2Ff.php%3Fh%3Db0f02e7cea67f168e25ec9b9f9d584f9");
assertEquals("https://bitcoincore.org/~gavin/f.php?h=b0f02e7cea67f168e25ec9b9f9d584f9", uri.getPaymentRequestUrl());
assertNull(uri.getAddress());
}
开发者ID:HashEngineering,项目名称:megacoinj,代码行数:8,代码来源:BitcoinURITest.java
示例11: MainNetParams
import com.google.bitcoin.core.CoinDefinition; //导入依赖的package包/类
public MainNetParams() {
super();
interval = INTERVAL;
targetTimespan = TARGET_TIMESPAN;
proofOfWorkLimit = CoinDefinition.proofOfWorkLimit;
dumpedPrivateKeyHeader = 128 + CoinDefinition.AddressHeader;
addressHeader = CoinDefinition.AddressHeader;
p2shHeader = CoinDefinition.p2shHeader;
acceptableAddressCodes = new int[] { addressHeader, p2shHeader};
port = CoinDefinition.Port;
packetMagic = CoinDefinition.PacketMagic;
genesisBlock.setDifficultyTarget(CoinDefinition.genesisBlockDifficultyTarget);
genesisBlock.setTime(CoinDefinition.genesisBlockTime);
genesisBlock.setNonce(CoinDefinition.genesisBlockNonce);
id = ID_MAINNET;
subsidyDecreaseBlockCount = CoinDefinition.subsidyDecreaseBlockCount;
spendableCoinbaseDepth = CoinDefinition.spendableCoinbaseDepth;
String genesisHash = genesisBlock.getHashAsString();
checkState(genesisHash.equals(CoinDefinition.genesisHash),
genesisHash);
CoinDefinition.initCheckpoints(checkpoints);
dnsSeeds = CoinDefinition.dnsSeeds;
}
开发者ID:cannabiscoindev,项目名称:cannabiscoinj,代码行数:29,代码来源:MainNetParams.java
示例12: onPreMessageReceived
import com.google.bitcoin.core.CoinDefinition; //导入依赖的package包/类
@Override
public Message onPreMessageReceived(Peer p, Message m) {
if (m instanceof AddressMessage) {
AddressMessage newMessage = new AddressMessage(params);
for (PeerAddress addr : ((AddressMessage) m).getAddresses())
if (!CoinDefinition.supportsBloomFiltering || addr.getServices().and(BigInteger.valueOf(1 << 1)).equals(BigInteger.valueOf(1 << 1)))
newMessage.addAddress(addr);
return parent.onPreMessageReceived(p, newMessage);
}
return m;
}
开发者ID:HashEngineering,项目名称:quarkcoinj,代码行数:12,代码来源:LitecoinPeerDBDiscovery.java
示例13: onPeerConnected
import com.google.bitcoin.core.CoinDefinition; //导入依赖的package包/类
@Override
public void onPeerConnected(Peer p, int peerCount) {
if (!CoinDefinition.supportsBloomFiltering || ((p.getPeerVersionMessage().localServices & (1<<1)) == (1<<1) &&
p.getPeerVersionMessage().clientVersion >= 70002))
parent.onPeerConnected(p, peerCount);
else
p.close();
}
开发者ID:HashEngineering,项目名称:quarkcoinj,代码行数:9,代码来源:LitecoinPeerDBDiscovery.java
示例14: TestNet3Params
import com.google.bitcoin.core.CoinDefinition; //导入依赖的package包/类
public TestNet3Params() {
super();
id = ID_TESTNET;
// Genesis hash is 000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943
packetMagic = 0x0b110907;
interval = INTERVAL;
targetTimespan = TARGET_TIMESPAN;
proofOfWorkLimit = Utils.decodeCompactBits(0x1d00ffffL);
port = 18333;
addressHeader = CoinDefinition.testnetAddressHeader;
p2shHeader = CoinDefinition.testnetp2shHeader;
acceptableAddressCodes = new int[] { addressHeader, p2shHeader };
dumpedPrivateKeyHeader = 128 + CoinDefinition.testnetAddressHeader;
genesisBlock.setTime(CoinDefinition.testnetGenesisBlockTime);
genesisBlock.setDifficultyTarget(CoinDefinition.testnetGenesisBlockDifficultyTarget);
genesisBlock.setNonce(CoinDefinition.testnetGenesisBlockNonce);
genesisBlock.setVersion(112);
spendableCoinbaseDepth = 100;
subsidyDecreaseBlockCount = CoinDefinition.subsidyDecreaseBlockCount;
genesisBlock.setMerkleRoot(new Sha256Hash("868b2fb28cb1a0b881480cc85eb207e29e6ae75cdd6d26688ed34c2d2d23c776"));
String genesisHash = genesisBlock.getHashAsString();
if(CoinDefinition.supportsTestNet)
checkState(genesisHash.equals(CoinDefinition.testnetGenesisHash));
alertSigningKey = Hex.decode(CoinDefinition.TESTNET_SATOSHI_KEY);
dnsSeeds = CoinDefinition.testnetDnsSeeds;
}
开发者ID:HashEngineering,项目名称:quarkcoinj,代码行数:32,代码来源:TestNet3Params.java
示例15: MainNetParams
import com.google.bitcoin.core.CoinDefinition; //导入依赖的package包/类
public MainNetParams() {
super();
interval = INTERVAL;
targetTimespan = TARGET_TIMESPAN;
proofOfWorkLimit = CoinDefinition.proofOfWorkLimit;
dumpedPrivateKeyHeader = 128 + CoinDefinition.AddressHeader;
addressHeader = CoinDefinition.AddressHeader;
p2shHeader = CoinDefinition.p2shHeader;
acceptableAddressCodes = new int[] { addressHeader, p2shHeader};
port = CoinDefinition.Port;
packetMagic = CoinDefinition.PacketMagic;
genesisBlock.setDifficultyTarget(CoinDefinition.genesisBlockDifficultyTarget);
genesisBlock.setTime(CoinDefinition.genesisBlockTime);
genesisBlock.setNonce(CoinDefinition.genesisBlockNonce);
genesisBlock.setVersion(112);
id = ID_MAINNET;
subsidyDecreaseBlockCount = CoinDefinition.subsidyDecreaseBlockCount;
spendableCoinbaseDepth = CoinDefinition.spendableCoinbaseDepth;
genesisBlock.setMerkleRoot(new Sha256Hash("868b2fb28cb1a0b881480cc85eb207e29e6ae75cdd6d26688ed34c2d2d23c776"));
String genesisHash = genesisBlock.getHashAsString();
log.info("Genesis Block (complete): " + genesisBlock.toString()) ;
checkState(genesisHash.equals(CoinDefinition.genesisHash),
genesisHash);
CoinDefinition.initCheckpoints(checkpoints);
dnsSeeds = CoinDefinition.dnsSeeds;
}
开发者ID:HashEngineering,项目名称:quarkcoinj,代码行数:32,代码来源:MainNetParams.java
示例16: TestNet3Params
import com.google.bitcoin.core.CoinDefinition; //导入依赖的package包/类
public TestNet3Params() {
super();
id = ID_TESTNET;
// Genesis hash is 000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943
packetMagic = 0xfcc1b7dc;
interval = INTERVAL;
targetTimespan = TARGET_TIMESPAN;
proofOfWorkLimit = Utils.decodeCompactBits(0x1d00ffffL);
port = 18523;
addressHeader = CoinDefinition.testnetAddressHeader;
p2shHeader = CoinDefinition.testnetp2shHeader;
acceptableAddressCodes = new int[] { addressHeader, p2shHeader };
dumpedPrivateKeyHeader = 128 + CoinDefinition.testnetAddressHeader;
genesisBlock.setTime(CoinDefinition.testnetGenesisBlockTime);
genesisBlock.setDifficultyTarget(CoinDefinition.testnetGenesisBlockDifficultyTarget);
genesisBlock.setNonce(CoinDefinition.testnetGenesisBlockNonce);
spendableCoinbaseDepth = 100;
subsidyDecreaseBlockCount = CoinDefinition.subsidyDecreaseBlockCount;
String genesisHash = genesisBlock.getHashAsString();
if(CoinDefinition.supportsTestNet)
checkState(genesisHash.equals(CoinDefinition.testnetGenesisHash));
alertSigningKey = Hex.decode(CoinDefinition.TESTNET_SATOSHI_KEY);
dnsSeeds = CoinDefinition.dnsSeeds;
}
开发者ID:9cat,项目名称:templecoin-java,代码行数:29,代码来源:TestNet3Params.java
示例17: TestNet3Params
import com.google.bitcoin.core.CoinDefinition; //导入依赖的package包/类
public TestNet3Params() {
super();
id = ID_TESTNET;
// Genesis hash is 000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943
packetMagic = 0x0b110907;
interval = INTERVAL;
targetTimespan = TARGET_TIMESPAN;
proofOfWorkLimit = Utils.decodeCompactBits(0x1d00ffffL);
port = 18333;
addressHeader = CoinDefinition.testnetAddressHeader;
p2shHeader = CoinDefinition.testnetp2shHeader;
acceptableAddressCodes = new int[] { addressHeader, p2shHeader };
dumpedPrivateKeyHeader = 128 + CoinDefinition.testnetAddressHeader;
genesisBlock.setTime(CoinDefinition.testnetGenesisBlockTime);
genesisBlock.setDifficultyTarget(CoinDefinition.testnetGenesisBlockDifficultyTarget);
genesisBlock.setNonce(CoinDefinition.testnetGenesisBlockNonce);
genesisBlock.setVersion(2);
spendableCoinbaseDepth = 100;
subsidyDecreaseBlockCount = CoinDefinition.subsidyDecreaseBlockCount;
genesisBlock.setMerkleRoot(new Sha256Hash("448f7de5e3a564ad723ea1ac11186466e35c9315acfba89d9b956b303340a7a9"));
String genesisHash = genesisBlock.getHashAsString();
if(CoinDefinition.supportsTestNet)
checkState(genesisHash.equals(CoinDefinition.testnetGenesisHash));
alertSigningKey = Hex.decode(CoinDefinition.TESTNET_SATOSHI_KEY);
dnsSeeds = CoinDefinition.testnetDnsSeeds;
}
开发者ID:testzcrypto,项目名称:animecoinj,代码行数:32,代码来源:TestNet3Params.java
示例18: MainNetParams
import com.google.bitcoin.core.CoinDefinition; //导入依赖的package包/类
public MainNetParams() {
super();
interval = INTERVAL;
targetTimespan = TARGET_TIMESPAN;
proofOfWorkLimit = CoinDefinition.proofOfWorkLimit;
dumpedPrivateKeyHeader = 128 + CoinDefinition.AddressHeader;
addressHeader = CoinDefinition.AddressHeader;
p2shHeader = CoinDefinition.p2shHeader;
acceptableAddressCodes = new int[] { addressHeader, p2shHeader};
port = CoinDefinition.Port;
packetMagic = CoinDefinition.PacketMagic;
genesisBlock.setDifficultyTarget(CoinDefinition.genesisBlockDifficultyTarget);
genesisBlock.setTime(CoinDefinition.genesisBlockTime);
genesisBlock.setNonce(CoinDefinition.genesisBlockNonce);
genesisBlock.setVersion(112);
id = ID_MAINNET;
subsidyDecreaseBlockCount = CoinDefinition.subsidyDecreaseBlockCount;
spendableCoinbaseDepth = CoinDefinition.spendableCoinbaseDepth;
genesisBlock.setMerkleRoot(new Sha256Hash("448f7de5e3a564ad723ea1ac11186466e35c9315acfba89d9b956b303340a7a9"));
String genesisHash = genesisBlock.getHashAsString();
log.info("Genesis Block (complete): " + genesisBlock.toString()) ;
checkState(genesisHash.equals(CoinDefinition.genesisHash),
genesisHash);
CoinDefinition.initCheckpoints(checkpoints);
dnsSeeds = CoinDefinition.dnsSeeds;
}
开发者ID:testzcrypto,项目名称:animecoinj,代码行数:32,代码来源:MainNetParams.java
注:本文中的com.google.bitcoin.core.CoinDefinition类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论