public UnspentTx(TransactionOutPoint txop, long value, int height) { super(txop, height); this.txPos = (int) txop.getIndex(); this.value = value; }
public UnspentTx(TransactionOutPoint txop, long value, int height) { super(txop, height); this.txPos = (int) txop.getIndex(); this.value = value; }
@Override public int hashCode() { return Objects.hashCode(getIndex(), getHash()); } }
@Override public int hashCode() { return Objects.hashCode(getIndex(), getHash()); } }
@Override public int hashCode() { return Objects.hashCode(getIndex(), getHash()); } }
/** * Locates the referenced output from the given pool of transactions. * * @return The TransactionOutput or null if the transactions map doesn't contain the referenced tx. */ @Nullable TransactionOutput getConnectedOutput(Map<Sha256Hash, Transaction> transactions) { Transaction tx = transactions.get(outpoint.getHash()); if (tx == null) return null; return tx.getOutputs().get((int) outpoint.getIndex()); }
/** * Locates the referenced output from the given pool of transactions. * * @return The TransactionOutput or null if the transactions map doesn't contain the referenced tx. */ @Nullable TransactionOutput getConnectedOutput(Map<Sha256Hash, Transaction> transactions) { Transaction tx = transactions.get(outpoint.getHash()); if (tx == null) return null; return tx.getOutputs().get((int) outpoint.getIndex()); }
/** * Locates the referenced output from the given pool of transactions. * * @return The TransactionOutput or null if the transactions map doesn't contain the referenced tx. */ @Nullable TransactionOutput getConnectedOutput(Map<Sha256Hash, Transaction> transactions) { Transaction tx = transactions.get(outpoint.getHash()); if (tx == null) return null; return tx.getOutputs().get((int) outpoint.getIndex()); }
/** * Coinbase transactions have special inputs with hashes of zero. If this is such an input, returns true. */ public boolean isCoinBase() { return outpoint.getHash().equals(Sha256Hash.ZERO_HASH) && (outpoint.getIndex() & 0xFFFFFFFFL) == 0xFFFFFFFFL; // -1 but all is serialized to the wire as unsigned int. }
/** * Coinbase transactions have special inputs with hashes of zero. If this is such an input, returns true. */ public boolean isCoinBase() { return outpoint.getHash().equals(Sha256Hash.ZERO_HASH) && (outpoint.getIndex() & 0xFFFFFFFFL) == 0xFFFFFFFFL; // -1 but all is serialized to the wire as unsigned int. }
/** * Coinbase transactions have special inputs with hashes of zero. If this is such an input, returns true. */ public boolean isCoinBase() { return outpoint.getHash().equals(Sha256Hash.ZERO_HASH) && (outpoint.getIndex() & 0xFFFFFFFFL) == 0xFFFFFFFFL; // -1 but all is serialized to the wire as unsigned int. }
/** * Coinbase transactions have special inputs with hashes of zero. If this is such an input, returns true. */ public boolean isCoinBase() { return outpoint.getHash().equals(Sha256Hash.ZERO_HASH) && (outpoint.getIndex() & 0xFFFFFFFFL) == 0xFFFFFFFFL; // -1 but all is serialized to the wire as unsigned int. }
/** * For a connected transaction, runs the script against the connected pubkey and verifies they are correct. * @throws ScriptException if the script did not verify. * @throws VerificationException If the outpoint doesn't match the given output. */ public void verify() throws VerificationException { final Transaction fromTx = getOutpoint().fromTx; long spendingIndex = getOutpoint().getIndex(); checkNotNull(fromTx, "Not connected"); final TransactionOutput output = fromTx.getOutput((int) spendingIndex); verify(output); }
/** * For a connected transaction, runs the script against the connected pubkey and verifies they are correct. * @throws ScriptException if the script did not verify. * @throws VerificationException If the outpoint doesn't match the given output. */ public void verify() throws VerificationException { final Transaction fromTx = getOutpoint().fromTx; long spendingIndex = getOutpoint().getIndex(); checkNotNull(fromTx, "Not connected"); final TransactionOutput output = fromTx.getOutput((int) spendingIndex); verify(output); }
/** * For a connected transaction, runs the script against the connected pubkey and verifies they are correct. * @throws ScriptException if the script did not verify. * @throws VerificationException If the outpoint doesn't match the given output. */ public void verify() throws VerificationException { final Transaction fromTx = getOutpoint().fromTx; long spendingIndex = getOutpoint().getIndex(); checkNotNull(fromTx, "Not connected"); final TransactionOutput output = fromTx.getOutput((int) spendingIndex); verify(output); }
/** * For a connected transaction, runs the script against the connected pubkey and verifies they are correct. * @throws ScriptException if the script did not verify. * @throws VerificationException If the outpoint doesn't match the given output. */ public void verify() throws VerificationException { final Transaction fromTx = getOutpoint().fromTx; long spendingIndex = getOutpoint().getIndex(); checkNotNull(fromTx, "Not connected"); final TransactionOutput output = fromTx.getOutput((int) spendingIndex); verify(output); }
@Override public int compare(TransactionInput o1, TransactionInput o2) { byte[] hash1 = o1.getOutpoint().getHash().getBytes(); byte[] hash2 = o2.getOutpoint().getHash().getBytes(); int hashCompare = LexicographicalComparator.getComparator().compare(hash1, hash2); if (hashCompare != 0) { return hashCompare; } else { return (int) (o1.getOutpoint().getIndex() - o2.getOutpoint().getIndex()); } } });