/** * Resets the spent pointer / availableForSpending flag to null. */ public void markAsUnspent() { if (parent != null) if (log.isDebugEnabled()) log.debug("Un-marked {}:{} as spent by {}", getParentTransactionHash(), getIndex(), spentBy); else if (log.isDebugEnabled()) log.debug("Un-marked floating output as spent by {}", spentBy); availableForSpending = true; spentBy = null; }
/** * Resets the spent pointer / availableForSpending flag to null. */ public void markAsUnspent() { if (parent != null) if (log.isDebugEnabled()) log.debug("Un-marked {}:{} as spent by {}", getParentTransactionHash(), getIndex(), spentBy); else if (log.isDebugEnabled()) log.debug("Un-marked floating output as spent by {}", spentBy); availableForSpending = true; spentBy = null; }
/** * Resets the spent pointer / availableForSpending flag to null. */ public void markAsUnspent() { if (parent != null) if (log.isDebugEnabled()) log.debug("Un-marked {}:{} as spent by {}", getParentTransactionHash(), getIndex(), spentBy); else if (log.isDebugEnabled()) log.debug("Un-marked floating output as spent by {}", spentBy); availableForSpending = true; spentBy = null; }
/** * Resets the spent pointer / availableForSpending flag to null. */ public void markAsUnspent() { if (parent != null) if (log.isDebugEnabled()) log.debug("Un-marked {}:{} as spent by {}", getParentTransactionHash(), getIndex(), spentBy); else if (log.isDebugEnabled()) log.debug("Un-marked floating output as spent by {}", spentBy); availableForSpending = true; spentBy = null; }
public TransactionOutPoint(NetworkParameters params, TransactionOutput connectedOutput) { this(params, connectedOutput.getIndex(), connectedOutput.getParentTransactionHash()); this.connectedOutput = connectedOutput; }
public TransactionOutPoint(NetworkParameters params, TransactionOutput connectedOutput) { this(params, connectedOutput.getIndex(), connectedOutput.getParentTransactionHash()); this.connectedOutput = connectedOutput; }
public TransactionOutPoint(NetworkParameters params, TransactionOutput connectedOutput) { this(params, connectedOutput.getIndex(), connectedOutput.getParentTransactionHash()); this.connectedOutput = connectedOutput; }
/** * Sets this objects availableForSpending flag to false and the spentBy pointer to the given input. * If the input is null, it means this output was signed over to somebody else rather than one of our own keys. * @throws IllegalStateException if the transaction was already marked as spent. */ public void markAsSpent(TransactionInput input) { checkState(availableForSpending); availableForSpending = false; spentBy = input; if (parent != null) if (log.isDebugEnabled()) log.debug("Marked {}:{} as spent by {}", getParentTransactionHash(), getIndex(), input); else if (log.isDebugEnabled()) log.debug("Marked floating output as spent by {}", input); }
/** * Sets this objects availableForSpending flag to false and the spentBy pointer to the given input. * If the input is null, it means this output was signed over to somebody else rather than one of our own keys. * @throws IllegalStateException if the transaction was already marked as spent. */ public void markAsSpent(TransactionInput input) { checkState(availableForSpending); availableForSpending = false; spentBy = input; if (parent != null) if (log.isDebugEnabled()) log.debug("Marked {}:{} as spent by {}", getParentTransactionHash(), getIndex(), input); else if (log.isDebugEnabled()) log.debug("Marked floating output as spent by {}", input); }
/** * Sets this objects availableForSpending flag to false and the spentBy pointer to the given input. * If the input is null, it means this output was signed over to somebody else rather than one of our own keys. * @throws IllegalStateException if the transaction was already marked as spent. */ public void markAsSpent(TransactionInput input) { checkState(availableForSpending); availableForSpending = false; spentBy = input; if (parent != null) if (log.isDebugEnabled()) log.debug("Marked {}:{} as spent by {}", getParentTransactionHash(), getIndex(), input); else if (log.isDebugEnabled()) log.debug("Marked floating output as spent by {}", input); }
/** * Sets this objects availableForSpending flag to false and the spentBy pointer to the given input. * If the input is null, it means this output was signed over to somebody else rather than one of our own keys. * @throws IllegalStateException if the transaction was already marked as spent. */ public void markAsSpent(TransactionInput input) { checkState(availableForSpending); availableForSpending = false; spentBy = input; if (parent != null) if (log.isDebugEnabled()) log.debug("Marked {}:{} as spent by {}", getParentTransactionHash(), getIndex(), input); else if (log.isDebugEnabled()) log.debug("Marked floating output as spent by {}", input); }
public TransactionOutPoint(NetworkParameters params, TransactionOutput connectedOutput) { this( params, connectedOutput.getIndex(), connectedOutput.getParentTransactionHash(), connectedOutput.getValue()); this.connectedOutput = connectedOutput; }
@Override public int compare(TransactionOutput a, TransactionOutput b) { int depth1 = a.getParentTransactionDepthInBlocks(); int depth2 = b.getParentTransactionDepthInBlocks(); Coin aValue = a.getValue(); Coin bValue = b.getValue(); BigInteger aCoinDepth = BigInteger.valueOf(aValue.value).multiply(BigInteger.valueOf(depth1)); BigInteger bCoinDepth = BigInteger.valueOf(bValue.value).multiply(BigInteger.valueOf(depth2)); int c1 = bCoinDepth.compareTo(aCoinDepth); if (c1 != 0) return c1; // The "coin*days" destroyed are equal, sort by value alone to get the lowest transaction size. int c2 = bValue.compareTo(aValue); if (c2 != 0) return c2; // They are entirely equivalent (possibly pending) so sort by hash to ensure a total ordering. BigInteger aHash = a.getParentTransactionHash().toBigInteger(); BigInteger bHash = b.getParentTransactionHash().toBigInteger(); return aHash.compareTo(bHash); } });
@Override public int compare(TransactionOutput a, TransactionOutput b) { int depth1 = a.getParentTransactionDepthInBlocks(); int depth2 = b.getParentTransactionDepthInBlocks(); Coin aValue = a.getValue(); Coin bValue = b.getValue(); BigInteger aCoinDepth = BigInteger.valueOf(aValue.value).multiply(BigInteger.valueOf(depth1)); BigInteger bCoinDepth = BigInteger.valueOf(bValue.value).multiply(BigInteger.valueOf(depth2)); int c1 = bCoinDepth.compareTo(aCoinDepth); if (c1 != 0) return c1; // The "coin*days" destroyed are equal, sort by value alone to get the lowest transaction size. int c2 = bValue.compareTo(aValue); if (c2 != 0) return c2; // They are entirely equivalent (possibly pending) so sort by hash to ensure a total ordering. BigInteger aHash = a.getParentTransactionHash().toBigInteger(); BigInteger bHash = b.getParentTransactionHash().toBigInteger(); return aHash.compareTo(bHash); } });
@Override public int compare(TransactionOutput a, TransactionOutput b) { int depth1 = a.getParentTransactionDepthInBlocks(); int depth2 = b.getParentTransactionDepthInBlocks(); Coin aValue = a.getValue(); Coin bValue = b.getValue(); BigInteger aCoinDepth = BigInteger.valueOf(aValue.value).multiply(BigInteger.valueOf(depth1)); BigInteger bCoinDepth = BigInteger.valueOf(bValue.value).multiply(BigInteger.valueOf(depth2)); int c1 = bCoinDepth.compareTo(aCoinDepth); if (c1 != 0) return c1; // The "coin*days" destroyed are equal, sort by value alone to get the lowest transaction size. int c2 = bValue.compareTo(aValue); if (c2 != 0) return c2; // They are entirely equivalent (possibly pending) so sort by hash to ensure a total ordering. BigInteger aHash = a.getParentTransactionHash().toBigInteger(); BigInteger bHash = b.getParentTransactionHash().toBigInteger(); return aHash.compareTo(bHash); } });
@Override public int compare(TransactionOutput a, TransactionOutput b) { int depth1 = a.getParentTransactionDepthInBlocks(); int depth2 = b.getParentTransactionDepthInBlocks(); Coin aValue = a.getValue(); Coin bValue = b.getValue(); BigInteger aCoinDepth = BigInteger.valueOf(aValue.value).multiply(BigInteger.valueOf(depth1)); BigInteger bCoinDepth = BigInteger.valueOf(bValue.value).multiply(BigInteger.valueOf(depth2)); int c1 = bCoinDepth.compareTo(aCoinDepth); if (c1 != 0) return c1; // The "coin*days" destroyed are equal, sort by value alone to get the lowest transaction size. int c2 = bValue.compareTo(aValue); if (c2 != 0) return c2; // They are entirely equivalent (possibly pending) so sort by hash to ensure a total ordering. BigInteger aHash = a.getParentTransactionHash().toBigInteger(); BigInteger bHash = b.getParentTransactionHash().toBigInteger(); return aHash.compareTo(bHash); } });
assertEquals(utxo.getHash(), txInToDisconnect.getOutpoint().connectedOutput.getParentTransactionHash());