public Transaction getBitcoinjTransaction() { return bitcoinjTxOutput.getParentTransaction(); } }
/** * Gets the index of this output in the parent transaction, or throws if this output is free standing. Iterates * over the parents list to discover this. */ public int getIndex() { List<TransactionOutput> outputs = getParentTransaction().getOutputs(); for (int i = 0; i < outputs.size(); i++) { if (outputs.get(i) == this) return i; } throw new IllegalStateException("Output linked to wrong parent transaction?"); }
/** * Gets the index of this output in the parent transaction, or throws if this output is free standing. Iterates * over the parents list to discover this. */ public int getIndex() { List<TransactionOutput> outputs = getParentTransaction().getOutputs(); for (int i = 0; i < outputs.size(); i++) { if (outputs.get(i) == this) return i; } throw new IllegalStateException("Output linked to wrong parent transaction?"); }
/** * Gets the index of this output in the parent transaction, or throws if this output is free standing. Iterates * over the parents list to discover this. */ public int getIndex() { List<TransactionOutput> outputs = getParentTransaction().getOutputs(); for (int i = 0; i < outputs.size(); i++) { if (outputs.get(i) == this) return i; } throw new IllegalStateException("Output linked to wrong parent transaction?"); }
/** * Gets the index of this output in the parent transaction, or throws if this output is free standing. Iterates * over the parents list to discover this. */ public int getIndex() { List<TransactionOutput> outputs = getParentTransaction().getOutputs(); for (int i = 0; i < outputs.size(); i++) { if (outputs.get(i) == this) return i; } throw new IllegalStateException("Output linked to wrong parent transaction?"); }
/** Internal use only: connects this TransactionInput to the given output (updates pointers and spent flags) */ public void connect(TransactionOutput out) { outpoint.fromTx = out.getParentTransaction(); out.markAsSpent(this); value = out.getValue(); }
/** * Returns a new {@link TransactionOutPoint}, which is essentially a structure pointing to this output. * Requires that this output is not detached. */ public TransactionOutPoint getOutPointFor() { return new TransactionOutPoint(params, getIndex(), getParentTransaction()); }
/** Internal use only: connects this TransactionInput to the given output (updates pointers and spent flags) */ public void connect(TransactionOutput out) { outpoint.fromTx = out.getParentTransaction(); out.markAsSpent(this); value = out.getValue(); }
/** Internal use only: connects this TransactionInput to the given output (updates pointers and spent flags) */ public void connect(TransactionOutput out) { outpoint.fromTx = out.getParentTransaction(); out.markAsSpent(this); value = out.getValue(); }
/** * Returns a new {@link TransactionOutPoint}, which is essentially a structure pointing to this output. * Requires that this output is not detached. */ public TransactionOutPoint getOutPointFor() { return new TransactionOutPoint(params, getIndex(), getParentTransaction()); }
/** * Returns a new {@link TransactionOutPoint}, which is essentially a structure pointing to this output. * Requires that this output is not detached. */ public TransactionOutPoint getOutPointFor() { return new TransactionOutPoint(params, getIndex(), getParentTransaction()); }
/** Internal use only: connects this TransactionInput to the given output (updates pointers and spent flags) */ public void connect(TransactionOutput out) { outpoint.fromTx = out.getParentTransaction(); out.markAsSpent(this); value = out.getValue(); }
/** * Returns a new {@link TransactionOutPoint}, which is essentially a structure pointing to this output. * Requires that this output is not detached. */ public TransactionOutPoint getOutPointFor() { return new TransactionOutPoint(params, getIndex(), getParentTransaction()); }
@Override public String getTransactionUrl() throws MissingTransactionInformationException { try { return BLOCKCHAIN_INFO_LINK + bitcoinjTxOutput.getParentTransaction().getHashAsString(); } catch (Exception e) { throw new MissingTransactionInformationException("Couldn't fetch transaction Id.", e); } }
@Override public String getTransactionId() throws MissingTransactionInformationException { try { Transaction transaction = bitcoinjTxOutput.getParentTransaction(); return transaction.getHashAsString() + "_" + String.valueOf(bitcoinjTxOutput.getIndex()); } catch (Exception e) { throw new MissingTransactionInformationException("Couldn't fetch transaction id.", e); } }
private boolean isConfirmed(TransactionOutput output) { return output.getParentTransaction().getConfidence().getConfidenceType().equals(TransactionConfidence.ConfidenceType.BUILDING); } }
private boolean isConfirmed(TransactionOutput output) { return output.getParentTransaction().getConfidence().getConfidenceType().equals(TransactionConfidence.ConfidenceType.BUILDING); } }
private boolean isConfirmed(TransactionOutput output) { return output.getParentTransaction().getConfidence().getConfidenceType().equals(TransactionConfidence.ConfidenceType.BUILDING); } }
private boolean isConfirmed(TransactionOutput output) { return output.getParentTransaction().getConfidence().getConfidenceType().equals(TransactionConfidence.ConfidenceType.BUILDING); } }
@Override protected void bitcoinSerializeToStream(OutputStream stream) throws IOException { Utils.uint32ToByteStreamLE(height, stream); stream.write(chainHead.getBytes()); stream.write(new VarInt(hits.length).encode()); stream.write(hits); stream.write(new VarInt(outputs.size()).encode()); for (int i = 0; i < outputs.size(); i++) { TransactionOutput output = outputs.get(i); Transaction tx = output.getParentTransaction(); Utils.uint32ToByteStreamLE(tx != null ? tx.getVersion() : 0L, stream); // Version Utils.uint32ToByteStreamLE(heights[i], stream); // Height output.bitcoinSerializeToStream(stream); } }