Java 类org.bitcoinj.core.WrongNetworkException 实例源码

项目:lbry-android    文件:BitAddress.java   
public static BitAddress from(CoinType type, int version, byte[] hash160)
        throws AddressMalformedException {
    try {
        return new BitAddress(type, version, hash160);
    } catch (WrongNetworkException e) {
        throw new AddressMalformedException(e);
    }
}
项目:lbry-android    文件:BitAddress.java   
public static BitAddress from(CoinType type, byte[] publicKeyHash160)
        throws AddressMalformedException {
    try {
        return new BitAddress(type, type.getAddressHeader(), publicKeyHash160);
    } catch (WrongNetworkException e) {
        throw new AddressMalformedException(e);
    }
}
项目:lbry-android    文件:BitAddress.java   
public static BitAddress from(CoinType type, Script script) throws AddressMalformedException {
    try {
        return new BitAddress(script.getToAddress(type));
    } catch (WrongNetworkException e) {
        throw new AddressMalformedException(e);
    }
}
项目:lbry-android    文件:BitAddress.java   
public static BitAddress from(Address address) throws AddressMalformedException {
    try {
        return new BitAddress(address);
    } catch (WrongNetworkException e) {
        throw new AddressMalformedException(e);
    }
}
项目:okwallet    文件:PaymentIntent.java   
public static PaymentIntent fromAddress(final String address, @Nullable final String addressLabel)
        throws WrongNetworkException, AddressFormatException {
    return new PaymentIntent(Address.fromBase58(Constants.NETWORK_PARAMETERS, address), addressLabel);
}
项目:okwallet    文件:PaymentIntent.java   
public static PaymentIntent from(final String address, @Nullable final String addressLabel,
        @Nullable final Coin amount) throws WrongNetworkException, AddressFormatException {
    return new PaymentIntent(null, null, null,
            buildSimplePayTo(amount, Address.fromBase58(Constants.NETWORK_PARAMETERS, address)), addressLabel, null,
            null, null, null);
}
项目:okwallet    文件:AddressAndLabel.java   
public AddressAndLabel(final NetworkParameters addressParams, final String address, @Nullable final String label)
        throws WrongNetworkException, AddressFormatException {
    this(Address.fromBase58(addressParams, address), label);
}
项目:lbry-android    文件:BitAddress.java   
BitAddress(Address address) throws WrongNetworkException {
    this((CoinType) address.getParameters(), address.getVersion(), address.getHash160());
}
项目:lbry-android    文件:BitAddress.java   
BitAddress(CoinType type, int version, byte[] hash160) throws WrongNetworkException {
    super(type, version, hash160);
}
项目:ombuds-android    文件:PaymentIntent.java   
public static PaymentIntent fromAddress(final String address, @Nullable final String addressLabel) throws WrongNetworkException,
        AddressFormatException
{
    return new PaymentIntent(new Address(Constants.NETWORK_PARAMETERS, address), addressLabel);
}
项目:ombuds-android    文件:AddressAndLabel.java   
public AddressAndLabel(final NetworkParameters addressParams, final String address, @Nullable final String label) throws WrongNetworkException,
        AddressFormatException
{
    this(new Address(addressParams, address), label);
}
项目:java-obelisk    文件:Subscriber.java   
/**
 * process for 'address.update' response
 * 
 * @throws
 */
public void doFilter(byte[] data) {
    ByteBuffer byteBuffer = ByteBuffer.wrap(data);

    // [ addr,version ] (1 byte)
    byte addressVersion = byteBuffer.get();

    // [ addr.hash ] (20 bytes)
    byte[] addressHash = new byte[ADDRESS_HASH_SIZE];
    byteBuffer.get(addressHash);
    ArrayUtils.reverse(addressHash);

    // [ height ] (4 bytes)
    byte[] bytes4 = new byte[4];
    byteBuffer.get(bytes4);
    final long height = EndianUtils.readSwappedUnsignedInteger(bytes4, 0);

    // [ block_hash ] (32 bytes)
    final byte[] blockHash = new byte[BLOCK_HASH_SIZE];
    byteBuffer.get(blockHash);
    ArrayUtils.reverse(blockHash);

    // [ tx ]
    final byte[] txBytes = new byte[data.length
            - (ADDRESS_VERSION_SIZE + ADDRESS_HASH_SIZE + HEIGHT_SIZE + BLOCK_HASH_SIZE)];
    byteBuffer.get(txBytes);

    Address addr = null;
    try {
        addr = new Address(MainNetParams.get(), addressVersion, addressHash);
    } catch (WrongNetworkException e) {
        e.printStackTrace();
    }

    if (addr == null)
        return;

    Listener listener = listeners.get(addr);

    if (listener == null)
        listener = globalListener;

    Transaction tx = new Transaction(MainNetParams.get(), txBytes);

    if (listener != null)
        listener.onUpdate(addr, height, blockHash, tx);
}