/** * Returns the transaction hash that owns this output. */ @Nullable public Sha256Hash getParentTransactionHash() { return parent == null ? null : parent.getHash(); }
/** * Returns the transaction hash that owns this output. */ @Nullable public Sha256Hash getParentTransactionHash() { return parent == null ? null : parent.getHash(); }
/** * Returns the transaction hash that owns this output. */ @Nullable public Sha256Hash getParentTransactionHash() { return parent == null ? null : parent.getHash(); }
/** * Returns the transaction hash that owns this output. */ @Nullable public Sha256Hash getParentTransactionHash() { return parent == null ? null : parent.getHash(); }
private boolean maybeHandleRequestedData(Message m) { boolean found = false; Sha256Hash hash = m.getHash(); for (GetDataRequest req : getDataFutures) { if (hash.equals(req.hash)) { req.future.set(m); getDataFutures.remove(req); found = true; // Keep going in case there are more. } } return found; }
private boolean maybeHandleRequestedData(Message m) { boolean found = false; Sha256Hash hash = m.getHash(); for (GetDataRequest req : getDataFutures) { if (hash.equals(req.hash)) { req.future.set(m); getDataFutures.remove(req); found = true; // Keep going in case there are more. } } return found; }
private boolean maybeHandleRequestedData(Message m) { boolean found = false; Sha256Hash hash = m.getHash(); for (GetDataRequest req : getDataFutures) { if (hash.equals(req.hash)) { req.future.set(m); getDataFutures.remove(req); found = true; // Keep going in case there are more. } } return found; }
private boolean maybeHandleRequestedData(Message m) { boolean found = false; Sha256Hash hash = m.getHash(); for (GetDataRequest req : getDataFutures) { if (hash.equals(req.hash)) { req.future.set(m); getDataFutures.remove(req); found = true; // Keep going in case there are more. } } return found; }
@Override public Message onPreMessageReceived (Peer peer, Message m) { if (m instanceof Block || m instanceof Transaction) { if (processedMessages.add(m.getHash())) { poolExecutor.submit((Runnable) () -> { if (m instanceof Block) { Iterator<OnBlockCommand> iterator = blockListener.iterator(); while (iterator.hasNext()) { OnBlockCommand onBlockCommand = iterator.next(); if (onBlockCommand.execute((Block) m)) { iterator.remove(); } } } else { Transaction transaction = (Transaction) m; Iterator<OnTxCommand> iterator = txListener.iterator(); while (iterator.hasNext()) { OnTxCommand onTxCommand = iterator.next(); if (onTxCommand.compare(transaction)) { onTxCommand.execute(transaction); iterator.remove(); } } } }); } } return m; }
/** * Returns true if this output is to a key, or an address we have the keys for, in the wallet. */ public boolean isMine(TransactionBag transactionBag) { try { Script script = getScriptPubKey(); if (script.isSentToRawPubKey()) { byte[] pubkey = script.getPubKey(); return transactionBag.isPubKeyMine(pubkey); } if (script.isPayToScriptHash()) { return transactionBag.isPayToScriptHashMine(script.getPubKeyHash()); } else { byte[] pubkeyHash = script.getPubKeyHash(); return transactionBag.isPubKeyHashMine(pubkeyHash); } } catch (ScriptException e) { // Just means we didn't understand the output of this transaction: ignore it. log.debug("Could not parse tx {} output script: {}", parent != null ? parent.getHash() : "(no parent)", e.toString()); return false; } }
/** * Returns true if this output is to a key, or an address we have the keys for, in the wallet. */ public boolean isMine(TransactionBag transactionBag) { try { Script script = getScriptPubKey(); if (script.isSentToRawPubKey()) { byte[] pubkey = script.getPubKey(); return transactionBag.isPubKeyMine(pubkey); } if (script.isPayToScriptHash()) { return transactionBag.isPayToScriptHashMine(script.getPubKeyHash()); } else { byte[] pubkeyHash = script.getPubKeyHash(); return transactionBag.isPubKeyHashMine(pubkeyHash); } } catch (ScriptException e) { // Just means we didn't understand the output of this transaction: ignore it. log.debug("Could not parse tx {} output script: {}", parent != null ? parent.getHash() : "(no parent)", e.toString()); return false; } }
/** * Returns true if this output is to a key, or an address we have the keys for, in the wallet. */ public boolean isMine(TransactionBag transactionBag) { try { Script script = getScriptPubKey(); if (script.isSentToRawPubKey()) { byte[] pubkey = script.getPubKey(); return transactionBag.isPubKeyMine(pubkey); } if (script.isPayToScriptHash()) { return transactionBag.isPayToScriptHashMine(script.getPubKeyHash()); } else { byte[] pubkeyHash = script.getPubKeyHash(); return transactionBag.isPubKeyHashMine(pubkeyHash); } } catch (ScriptException e) { // Just means we didn't understand the output of this transaction: ignore it. log.debug("Could not parse tx {} output script: {}", parent != null ? parent.getHash() : "(no parent)", e.toString()); return false; } }
/** * Returns true if this output is to a key, or an address we have the keys for, in the wallet. */ public boolean isMine(TransactionBag transactionBag) { try { Script script = getScriptPubKey(); if (script.isSentToRawPubKey()) { byte[] pubkey = script.getPubKey(); return transactionBag.isPubKeyMine(pubkey); } if (script.isPayToScriptHash()) { return transactionBag.isPayToScriptHashMine(script.getPubKeyHash()); } else { byte[] pubkeyHash = script.getPubKeyHash(); return transactionBag.isPubKeyHashMine(pubkeyHash); } } catch (ScriptException e) { // Just means we didn't understand the output of this transaction: ignore it. log.debug("Could not parse tx {} output script: {}", parent != null ? parent.getHash() : "(no parent)", e.toString()); return false; } }
assertEquals(t3.getHash(), outbound(p1).getHash());