@Override public int hashCode() { return Objects.hashCode(getId()); }
@Override public int hashCode() { return Objects.hashCode(getId()); }
@JsonProperty("netid") public String getNetIdString() { return netParams.getId(); }
@Override public int hashCode() { return Objects.hashCode(getId()); }
@Override public int hashCode() { return Objects.hashCode(getId()); }
private void writeObject(ObjectOutputStream out) throws IOException { out.defaultWriteObject(); out.writeUTF(params.getId()); }
/** * @param networkParameters The Bitcoin network parameters */ public BitcoinNetworkService(NetworkParameters networkParameters) { super(); Preconditions.checkNotNull(networkParameters, "'networkParameters' must be present"); log.debug("Bitcoin network service using '{}'", networkParameters.getId()); this.networkParameters = networkParameters; requireFixedThreadPoolExecutor(5, "bitcoin-network"); }
public BitcoinCrypto(NetworkParameters networkParameters, DeterministicSeed seed) throws Exception, NoSuchAlgorithmException { this.params = NetworkParameters.fromID(networkParameters.getId()); this.keyChainGroup = new KeyChainGroup(networkParameters, seed); Security.insertProviderAt(new BouncyCastleProvider(), 1); crashIfJCEMissing(); //this.sr = SecureRandom.getInstance("SHA1PRNG", new BouncyCastleProvider()); this.sr = SecureRandom.getInstance("SHA1PRNG"); this.keyPG = KeyPairGenerator.getInstance("ECIES", new BouncyCastleProvider()); //this.kit = initKit(seed); //this.wallet = kit.wallet(); }
public BitcoinCrypto(NetworkParameters networkParameters) throws NoSuchAlgorithmException, Exception { this.params = NetworkParameters.fromID(networkParameters.getId()); this.keyChainGroup = new KeyChainGroup(networkParameters); Security.insertProviderAt(new BouncyCastleProvider(), 1); crashIfJCEMissing(); //this.sr = SecureRandom.getInstance("SHA1PRNG", new BouncyCastleProvider()); this.sr = SecureRandom.getInstance("SHA1PRNG"); this.keyPG = KeyPairGenerator.getInstance("ECIES", new BouncyCastleProvider()); //this.kit = getKit(); //this.wallet = getKit().wallet(); }
public static boolean isSelectable(Transaction tx) { // Only pick chain-included transactions, or transactions that are ours and pending. TransactionConfidence confidence = tx.getConfidence(); TransactionConfidence.ConfidenceType type = confidence.getConfidenceType(); return type.equals(TransactionConfidence.ConfidenceType.BUILDING) || type.equals(TransactionConfidence.ConfidenceType.PENDING) && confidence.getSource().equals(TransactionConfidence.Source.SELF) && // In regtest mode we expect to have only one peer, so we won't see transactions propagate. // TODO: The value 1 below dates from a time when transactions we broadcast *to* were counted, set to 0 (confidence.numBroadcastPeers() > 1 || tx.getParams().getId().equals(NetworkParameters.ID_REGTEST)); } }
public static boolean isSelectable(Transaction tx) { // Only pick chain-included transactions, or transactions that are ours and pending. TransactionConfidence confidence = tx.getConfidence(); TransactionConfidence.ConfidenceType type = confidence.getConfidenceType(); return type.equals(TransactionConfidence.ConfidenceType.BUILDING) || type.equals(TransactionConfidence.ConfidenceType.PENDING) && confidence.getSource().equals(TransactionConfidence.Source.SELF) && // In regtest mode we expect to have only one peer, so we won't see transactions propagate. // TODO: The value 1 below dates from a time when transactions we broadcast *to* were counted, set to 0 (confidence.numBroadcastPeers() > 1 || tx.getParams().getId().equals(NetworkParameters.ID_REGTEST)); } }
public static boolean isSelectable(Transaction tx) { // Only pick chain-included transactions, or transactions that are ours and pending. TransactionConfidence confidence = tx.getConfidence(); TransactionConfidence.ConfidenceType type = confidence.getConfidenceType(); return type.equals(TransactionConfidence.ConfidenceType.BUILDING) || type.equals(TransactionConfidence.ConfidenceType.PENDING) && confidence.getSource().equals(TransactionConfidence.Source.SELF) && // In regtest mode we expect to have only one peer, so we won't see transactions propagate. // TODO: The value 1 below dates from a time when transactions we broadcast *to* were counted, set to 0 (confidence.numBroadcastPeers() > 1 || tx.getParams().getId().equals(NetworkParameters.ID_REGTEST)); } }
public static boolean isSelectable(Transaction tx) { // Only pick chain-included transactions, or transactions that are ours and pending. TransactionConfidence confidence = tx.getConfidence(); TransactionConfidence.ConfidenceType type = confidence.getConfidenceType(); return type.equals(TransactionConfidence.ConfidenceType.BUILDING) || type.equals(TransactionConfidence.ConfidenceType.PENDING) && confidence.getSource().equals(TransactionConfidence.Source.SELF) && // In regtest mode we expect to have only one peer, so we won't see transactions propagate. // TODO: The value 1 below dates from a time when transactions we broadcast *to* were counted, set to 0 (confidence.numBroadcastPeers() > 1 || tx.getParams().getId().equals(NetworkParameters.ID_REGTEST)); } }
@Test public void getNetwork() throws Exception { NetworkParameters params = Address.getParametersFromAddress("17kzeh4N8g49GFvdDzSf8PjaPfyoD1MndL"); assertEquals(MainNetParams.get().getId(), params.getId()); params = Address.getParametersFromAddress("n4eA2nbYqErp7H6jebchxAN59DmNpksexv"); assertEquals(TestNet3Params.get().getId(), params.getId()); }
@Test public void testGetParams() throws Exception { assertEquals("Test that default params are testnet",NetworkParameters.fromID(NetworkParameters.ID_TESTNET),bitcoinCryptoNoP.getParams()); // assertEquals("Test for mainnet params that got parsed to constructor ",NetworkParameters.fromID(NetworkParameters.ID_MAINNET),bitcoinCryptoMain.getParams()); assertEquals(NetworkParameters.ID_TESTNET,bitcoinCryptoNoP.getParams().getId()); }