@Override public void transaction(Transaction transaction) { if (transaction.confirmations() < minConf) return; if (!markProcess(transaction.txId())) return; confirmed(transaction); }
private void updateMonitorBlock() throws GenericRpcException { monitorBlock = lastBlock; for(int i = 0; i < monitorDepth && monitorBlock != null; i++) { BitcoindRpcClient.Block b = bitcoin.getBlock(monitorBlock); monitorBlock = b == null ? null : b.previousHash(); } }
@Override @SuppressWarnings("unchecked") public TransactionsSinceBlock listSinceBlock() throws GenericRpcException { return new TransactionsSinceBlockImpl((Map<String, ?>) query("listsinceblock")); }
@SuppressWarnings("unchecked") public RawTransaction decodeRawTransaction(String hex) throws GenericRpcException { Map<String, ?> result = (Map<String, ?>) query("decoderawtransaction", hex); RawTransaction rawTransaction = new RawTransactionImpl(result); return rawTransaction.vOut().get(0).transaction(); }
@Override @SuppressWarnings({ "unchecked" }) public MiningInfo getMiningInfo() throws GenericRpcException { return new MiningInfoWrapper((Map<String, ?>) query("getmininginfo")); }
@Override @SuppressWarnings("unchecked") public RawTransaction getRawTransaction(String txId) throws GenericRpcException { return new RawTransactionImpl((Map<String, Object>) query("getrawtransaction", txId, 1)); }
@Override @SuppressWarnings({ "unchecked" }) public TxOutSetInfo getTxOutSetInfo() throws GenericRpcException { return new TxOutSetInfoWrapper((Map<String, ?>) query("gettxoutsetinfo")); }
@Override @SuppressWarnings("unchecked") public List<ReceivedAddress> listReceivedByAddress(int minConf, boolean includeEmpty) throws GenericRpcException { return new ReceivedAddressListWrapper((List<Map<String, ?>>) query("listreceivedbyaddress", minConf, includeEmpty)); }
@Override @SuppressWarnings({ "unchecked" }) public BlockChainInfo getBlockChainInfo() throws GenericRpcException { return new BlockChainInfoMapWrapper((Map<String, ?>) query("getblockchaininfo")); }
@Override @SuppressWarnings("unchecked") public WalletInfo getWalletInfo() { return new WalletInfoWrapper((Map<String, ?>) query("getwalletinfo")); }
@Override @SuppressWarnings("unchecked") public DecodedScript decodeScript(String hex) throws GenericRpcException { return new DecodedScriptImpl((Map<String, ?>) query("decodescript", hex)); }
@Override @SuppressWarnings("unchecked") public List<Transaction> listTransactions(String account, int count, int skip) throws GenericRpcException { return new TransactionListMapWrapper((List<Map<String, ?>>) query("listtransactions", account, count, skip)); }
@Override @SuppressWarnings({ "unchecked" }) public Block getBlock(String blockHash) throws GenericRpcException { return new BlockMapWrapper((Map<String, ?>) query("getblock", blockHash)); }
private void updateMonitorBlock() throws GenericRpcException { monitorBlock = lastBlock; for(int i = 0; i < monitorDepth && monitorBlock != null; i++) { BitcoindRpcClient.Block b = bitcoin.getBlock(monitorBlock); monitorBlock = b == null ? null : b.previousHash(); } }
@Override @SuppressWarnings("unchecked") public TransactionsSinceBlock listSinceBlock(String blockHash) throws GenericRpcException { return new TransactionsSinceBlockImpl((Map<String, ?>) query("listsinceblock", blockHash)); }
@Override @SuppressWarnings({ "unchecked" }) public MiningInfo getMiningInfo() throws GenericRpcException { return new MiningInfoWrapper((Map<String, ?>) query("getmininginfo")); }
@Override @SuppressWarnings("unchecked") public RawTransaction getRawTransaction(String txId) throws GenericRpcException { return new RawTransactionImpl((Map<String, Object>) query("getrawtransaction", txId, 1)); }
@Override @SuppressWarnings({ "unchecked" }) public TxOutSetInfo getTxOutSetInfo() throws GenericRpcException { return new TxOutSetInfoWrapper((Map<String, ?>) query("gettxoutsetinfo")); }
@Override @SuppressWarnings("unchecked") public List<ReceivedAddress> listReceivedByAddress() throws GenericRpcException { return new ReceivedAddressListWrapper((List<Map<String, ?>>) query("listreceivedbyaddress")); }
@Override @SuppressWarnings("unchecked") public TransactionsSinceBlock listSinceBlock(String blockHash, int targetConfirmations) throws GenericRpcException { return new TransactionsSinceBlockImpl((Map<String, ?>) query("listsinceblock", blockHash, targetConfirmations)); }