@Test public void getUTXOs() throws Exception { connectWithVersion(GetUTXOsMessage.MIN_PROTOCOL_VERSION, VersionMessage.NODE_NETWORK | VersionMessage.NODE_GETUTXOS); TransactionOutPoint op1 = new TransactionOutPoint(UNITTEST, 1, Sha256Hash.of("foo".getBytes())); TransactionOutPoint op2 = new TransactionOutPoint(UNITTEST, 2, Sha256Hash.of("bar".getBytes())); ListenableFuture<UTXOsMessage> future1 = peer.getUTXOs(ImmutableList.of(op1)); ListenableFuture<UTXOsMessage> future2 = peer.getUTXOs(ImmutableList.of(op2)); GetUTXOsMessage msg1 = (GetUTXOsMessage) outbound(writeTarget); GetUTXOsMessage msg2 = (GetUTXOsMessage) outbound(writeTarget); assertEquals(op1, msg1.getOutPoints().get(0)); assertEquals(op2, msg2.getOutPoints().get(0)); assertEquals(1, msg1.getOutPoints().size()); assertFalse(future1.isDone()); ECKey key = new ECKey(); TransactionOutput out1 = new TransactionOutput(UNITTEST, null, Coin.CENT, key); UTXOsMessage response1 = new UTXOsMessage(UNITTEST, ImmutableList.of(out1), new long[]{UTXOsMessage.MEMPOOL_HEIGHT}, Sha256Hash.ZERO_HASH, 1234); inbound(writeTarget, response1); assertEquals(future1.get(), response1); TransactionOutput out2 = new TransactionOutput(UNITTEST, null, Coin.ONE_COIN, key); UTXOsMessage response2 = new UTXOsMessage(UNITTEST, ImmutableList.of(out2), new long[]{1000}, Sha256Hash.ZERO_HASH, 1234); inbound(writeTarget, response2); assertEquals(future2.get(), response2); }
public ListenableFuture<UTXOsMessage> getUTXOs(List<TransactionOutPoint> outPoints) { return getUTXOs(outPoints, true); }
Peer extends PeerSocketHandler { public ListenableFuture<UTXOsMessage> getUTXOs(List<TransactionOutPoint> outPoints) { return getUTXOs(outPoints, true); } }
Peer extends PeerSocketHandler { public ListenableFuture<UTXOsMessage> getUTXOs(List<TransactionOutPoint> outPoints) { return getUTXOs(outPoints, true); } Peer(NetworkParameters params, VersionMessage ver, @Nullable AbstractBlockChain chain, PeerAddress remoteAddress);  Peer(NetworkParameters params, VersionMessage ver, PeerAddress remoteAddress,
                @Nullable AbstractBlockChain chain);  Peer(NetworkParameters params, VersionMessage ver, PeerAddress remoteAddress,
                @Nullable AbstractBlockChain chain, int downloadTxDependencyDepth);  Peer(NetworkParameters params, AbstractBlockChain blockChain, PeerAddress peerAddress, String thisSoftwareName, String thisSoftwareVersion); }
Peer extends PeerSocketHandler { public ListenableFuture<UTXOsMessage> getUTXOs(List<TransactionOutPoint> outPoints) { return getUTXOs(outPoints, true); } Peer(NetworkParameters params, VersionMessage ver, @Nullable AbstractBlockChain chain, PeerAddress remoteAddress);  Peer(NetworkParameters params, VersionMessage ver, PeerAddress remoteAddress,
                @Nullable AbstractBlockChain chain);  Peer(NetworkParameters params, VersionMessage ver, PeerAddress remoteAddress,
                @Nullable AbstractBlockChain chain, int downloadTxDependencyDepth);  Peer(NetworkParameters params, AbstractBlockChain blockChain, PeerAddress peerAddress, String thisSoftwareName, String thisSoftwareVersion); @Deprecated @SuppressWarnings("deprecation") void addEventListener(AbstractPeerEventListener listener); @Deprecated void addEventListener(AbstractPeerEventListener listener, Executor executor); @Deprecated void removeEventListener(AbstractPeerEventListener listener); void addBlocksDownloadedEventListener(BlocksDownloadedEventListener listener); void addBlocksDownloadedEventListener(Executor executor, BlocksDownloadedEventListener listener); void addChainDownloadStartedEventListener(ChainDownloadStartedEventListener listener); void addChainDownloadStartedEventListener(Executor executor, ChainDownloadStartedEventListener listener); void addConnectedEventListener(PeerConnectedEventListener listener); void addConnectedEventListener(Executor executor, PeerConnectedEventListener listener); void addDisconnectedEventListener(PeerDisconnectedEventListener listener); void addDisconnectedEventListener(Executor executor, PeerDisconnectedEventListener listener); void addGetDataEventListener(GetDataEventListener listener); void addGetDataEventListener(Executor executor, GetDataEventListener listener); void addOnTransactionBroadcastListener(OnTransactionBroadcastListener listener); void addOnTransactionBroadcastListener(Executor executor, OnTransactionBroadcastListener listener); void addPreMessageReceivedEventListener(PreMessageReceivedEventListener listener); void addPreMessageReceivedEventListener(Executor executor, PreMessageReceivedEventListener listener); boolean removeBlocksDownloadedEventListener(BlocksDownloadedEventListener listener); boolean removeChainDownloadStartedEventListener(ChainDownloadStartedEventListener listener); boolean removeConnectedEventListener(PeerConnectedEventListener listener); boolean removeDisconnectedEventListener(PeerDisconnectedEventListener listener); boolean removeGetDataEventListener(GetDataEventListener listener); boolean removeOnTransactionBroadcastListener(OnTransactionBroadcastListener listener); boolean removePreMessageReceivedEventListener(PreMessageReceivedEventListener listener); @Override String toString(); @Override void connectionClosed(); @Override void connectionOpened(); ListenableFuture<Peer> getConnectionOpenFuture(); ListenableFuture<Peer> getVersionHandshakeFuture(); ListenableFuture<List<Transaction>> downloadDependencies(Transaction tx); @SuppressWarnings("unchecked") // The 'unchecked conversion' warning being suppressed here comes from the sendSingleGetData() formally returning // ListenableFuture instead of ListenableFuture<Block>. This is okay as sendSingleGetData() actually returns // ListenableFuture<Block> in this context. Note that sendSingleGetData() is also used for Transactions. ListenableFuture<Block> getBlock(Sha256Hash blockHash); @SuppressWarnings("unchecked") // The 'unchecked conversion' warning being suppressed here comes from the sendSingleGetData() formally returning // ListenableFuture instead of ListenableFuture<Transaction>. This is okay as sendSingleGetData() actually returns // ListenableFuture<Transaction> in this context. Note that sendSingleGetData() is also used for Blocks. ListenableFuture<Transaction> getPeerMempoolTransaction(Sha256Hash hash); ListenableFuture<AddressMessage> getAddr(); void setDownloadParameters(long secondsSinceEpoch, boolean useFilteredBlocks); void addWallet(Wallet wallet); void removeWallet(Wallet wallet); void startBlockChainDownload(); ListenableFuture<Long> ping(); long getLastPingTime(); long getPingTime(); int getPeerBlockHeightDifference(); boolean isDownloadData(); void setDownloadData(boolean downloadData); VersionMessage getPeerVersionMessage(); VersionMessage getVersionMessage(); long getBestHeight(); boolean setMinProtocolVersion(int minProtocolVersion); void setBloomFilter(BloomFilter filter); void setBloomFilter(BloomFilter filter, boolean andQueryMemPool); BloomFilter getBloomFilter(); ListenableFuture<UTXOsMessage> getUTXOs(List<TransactionOutPoint> outPoints); ListenableFuture<UTXOsMessage> getUTXOs(List<TransactionOutPoint> outPoints, boolean includeMempool); boolean isDownloadTxDependencies(); void setDownloadTxDependencies(boolean enable); void setDownloadTxDependencies(int depth); }
Peer extends PeerSocketHandler { public ListenableFuture<UTXOsMessage> getUTXOs(List<TransactionOutPoint> outPoints) { return getUTXOs(outPoints, true); } Peer(NetworkParameters params, VersionMessage ver, @Nullable AbstractBlockChain chain, PeerAddress remoteAddress);  Peer(NetworkParameters params, VersionMessage ver, PeerAddress remoteAddress,
                @Nullable AbstractBlockChain chain);  Peer(NetworkParameters params, VersionMessage ver, PeerAddress remoteAddress,
                @Nullable AbstractBlockChain chain, int downloadTxDependencyDepth);  Peer(NetworkParameters params, AbstractBlockChain blockChain, PeerAddress peerAddress, String thisSoftwareName, String thisSoftwareVersion); @Deprecated @SuppressWarnings("deprecation") void addEventListener(AbstractPeerEventListener listener); @Deprecated void addEventListener(AbstractPeerEventListener listener, Executor executor); @Deprecated void removeEventListener(AbstractPeerEventListener listener); void addBlocksDownloadedEventListener(BlocksDownloadedEventListener listener); void addBlocksDownloadedEventListener(Executor executor, BlocksDownloadedEventListener listener); void addChainDownloadStartedEventListener(ChainDownloadStartedEventListener listener); void addChainDownloadStartedEventListener(Executor executor, ChainDownloadStartedEventListener listener); void addConnectedEventListener(PeerConnectedEventListener listener); void addConnectedEventListener(Executor executor, PeerConnectedEventListener listener); void addDisconnectedEventListener(PeerDisconnectedEventListener listener); void addDisconnectedEventListener(Executor executor, PeerDisconnectedEventListener listener); void addGetDataEventListener(GetDataEventListener listener); void addGetDataEventListener(Executor executor, GetDataEventListener listener); void addOnTransactionBroadcastListener(OnTransactionBroadcastListener listener); void addOnTransactionBroadcastListener(Executor executor, OnTransactionBroadcastListener listener); void addPreMessageReceivedEventListener(PreMessageReceivedEventListener listener); void addPreMessageReceivedEventListener(Executor executor, PreMessageReceivedEventListener listener); boolean removeBlocksDownloadedEventListener(BlocksDownloadedEventListener listener); boolean removeChainDownloadStartedEventListener(ChainDownloadStartedEventListener listener); boolean removeConnectedEventListener(PeerConnectedEventListener listener); boolean removeDisconnectedEventListener(PeerDisconnectedEventListener listener); boolean removeGetDataEventListener(GetDataEventListener listener); boolean removeOnTransactionBroadcastListener(OnTransactionBroadcastListener listener); boolean removePreMessageReceivedEventListener(PreMessageReceivedEventListener listener); @Override String toString(); @Override void connectionClosed(); @Override void connectionOpened(); ListenableFuture<Peer> getConnectionOpenFuture(); ListenableFuture<Peer> getVersionHandshakeFuture(); ListenableFuture<List<Transaction>> downloadDependencies(Transaction tx); @SuppressWarnings("unchecked") // The 'unchecked conversion' warning being suppressed here comes from the sendSingleGetData() formally returning // ListenableFuture instead of ListenableFuture<Block>. This is okay as sendSingleGetData() actually returns // ListenableFuture<Block> in this context. Note that sendSingleGetData() is also used for Transactions. ListenableFuture<Block> getBlock(Sha256Hash blockHash); @SuppressWarnings("unchecked") // The 'unchecked conversion' warning being suppressed here comes from the sendSingleGetData() formally returning // ListenableFuture instead of ListenableFuture<Transaction>. This is okay as sendSingleGetData() actually returns // ListenableFuture<Transaction> in this context. Note that sendSingleGetData() is also used for Blocks. ListenableFuture<Transaction> getPeerMempoolTransaction(Sha256Hash hash); ListenableFuture<AddressMessage> getAddr(); void setDownloadParameters(long secondsSinceEpoch, boolean useFilteredBlocks); void addWallet(Wallet wallet); void removeWallet(Wallet wallet); void startBlockChainDownload(); ListenableFuture<Long> ping(); long getLastPingTime(); long getPingTime(); int getPeerBlockHeightDifference(); boolean isDownloadData(); void setDownloadData(boolean downloadData); VersionMessage getPeerVersionMessage(); VersionMessage getVersionMessage(); long getBestHeight(); boolean setMinProtocolVersion(int minProtocolVersion); void setBloomFilter(BloomFilter filter); void setBloomFilter(BloomFilter filter, boolean andQueryMemPool); BloomFilter getBloomFilter(); ListenableFuture<UTXOsMessage> getUTXOs(List<TransactionOutPoint> outPoints); ListenableFuture<UTXOsMessage> getUTXOs(List<TransactionOutPoint> outPoints, boolean includeMempool); boolean isDownloadTxDependencies(); void setDownloadTxDependencies(boolean enable); void setDownloadTxDependencies(int depth);  }