if (params != null && amount.isGreaterThan(params.getMaxMoney())) throw new BitcoinURIParseException("Max number of coins exceeded"); if (amount.signum() < 0)
if (params != null && amount.isGreaterThan(params.getMaxMoney())) throw new BitcoinURIParseException("Max number of coins exceeded"); if (amount.signum() < 0)
if (params != null && amount.isGreaterThan(params.getMaxMoney())) throw new BitcoinURIParseException("Max number of coins exceeded"); if (amount.signum() < 0)
if (params != null && amount.isGreaterThan(params.getMaxMoney())) throw new BitcoinURIParseException("Max number of coins exceeded"); if (amount.signum() < 0)
final Coin payout = Coin.valueOf(totalPayout.getValue()); UTXO inputUtxo = this.utxoList.stream() .filter(utxo -> utxo.getAddress().equals(fromAddress) && utxo.getValue().isGreaterThan(payout)) .findFirst().orElse(null); if (null == inputUtxo) {
if(valueOut.isGreaterThan(Coin.valueOf((int) context.sporkManager.getSporkValue(SporkManager.SPORK_5_INSTANTSEND_MAX_VALUE), 0))){ log.info("instantsend-IsIXTXValid - Transaction value too high - {}\n", txCollateral.toString()); return false;
/** * Construct a SendRequest for a CPFP (child-pays-for-parent) transaction. The resulting transaction is already * completed, so you should directly proceed to signing and broadcasting/committing the transaction. CPFP is * currently only supported by a few miners, so use with care. */ public static SendRequest childPaysForParent(Wallet wallet, Transaction parentTransaction, Coin feeRaise) { TransactionOutput outputToSpend = null; for (final TransactionOutput output : parentTransaction.getOutputs()) { if (output.isMine(wallet) && output.isAvailableForSpending() && output.getValue().isGreaterThan(feeRaise)) { outputToSpend = output; break; } } // TODO spend another confirmed output of own wallet if needed checkNotNull(outputToSpend, "Can't find adequately sized output that spends to us"); final Transaction tx = new Transaction(parentTransaction.getParams()); tx.addInput(outputToSpend); tx.addOutput(outputToSpend.getValue().subtract(feeRaise), wallet.freshAddress(KeyPurpose.CHANGE)); tx.setPurpose(Transaction.Purpose.RAISE_FEE); final SendRequest req = forTx(tx); req.completed = true; return req; }
if(nValueIn.isGreaterThan(Coin.valueOf((int)Context.get().sporkManager.getSporkValue(SporkManager.SPORK_5_INSTANTSEND_MAX_VALUE), 0))) { log.info("instantsend--CTxLockRequest::IsValid -- Transaction value too high: nValueOut="+nValueOut+", tx="+toString()); return false;
/** * Construct a SendRequest for a CPFP (child-pays-for-parent) transaction. The resulting transaction is already * completed, so you should directly proceed to signing and broadcasting/committing the transaction. CPFP is * currently only supported by a few miners, so use with care. */ public static SendRequest childPaysForParent(Wallet wallet, Transaction parentTransaction, Coin feeRaise) { TransactionOutput outputToSpend = null; for (final TransactionOutput output : parentTransaction.getOutputs()) { if (output.isMine(wallet) && output.isAvailableForSpending() && output.getValue().isGreaterThan(feeRaise)) { outputToSpend = output; break; } } // TODO spend another confirmed output of own wallet if needed checkNotNull(outputToSpend, "Can't find adequately sized output that spends to us"); final Transaction tx = new Transaction(parentTransaction.getParams()); tx.addInput(outputToSpend); tx.addOutput(outputToSpend.getValue().subtract(feeRaise), wallet.freshAddress(KeyPurpose.CHANGE)); tx.setPurpose(Transaction.Purpose.RAISE_FEE); final SendRequest req = forTx(tx); req.completed = true; return req; }
/** * Construct a SendRequest for a CPFP (child-pays-for-parent) transaction. The resulting transaction is already * completed, so you should directly proceed to signing and broadcasting/committing the transaction. CPFP is * currently only supported by a few miners, so use with care. */ public static SendRequest childPaysForParent(Wallet wallet, Transaction parentTransaction, Coin feeRaise) { TransactionOutput outputToSpend = null; for (final TransactionOutput output : parentTransaction.getOutputs()) { if (output.isMine(wallet) && output.isAvailableForSpending() && output.getValue().isGreaterThan(feeRaise)) { outputToSpend = output; break; } } // TODO spend another confirmed output of own wallet if needed checkNotNull(outputToSpend, "Can't find adequately sized output that spends to us"); final Transaction tx = new Transaction(parentTransaction.getParams()); tx.addInput(outputToSpend); tx.addOutput(outputToSpend.getValue().subtract(feeRaise), wallet.freshAddress(KeyPurpose.CHANGE)); tx.setPurpose(Transaction.Purpose.RAISE_FEE); final SendRequest req = forTx(tx); req.completed = true; return req; }
/** * Construct a SendRequest for a CPFP (child-pays-for-parent) transaction. The resulting transaction is already * completed, so you should directly proceed to signing and broadcasting/committing the transaction. CPFP is * currently only supported by a few miners, so use with care. */ public static SendRequest childPaysForParent(Wallet wallet, Transaction parentTransaction, Coin feeRaise) { TransactionOutput outputToSpend = null; for (final TransactionOutput output : parentTransaction.getOutputs()) { if (output.isMine(wallet) && output.isAvailableForSpending() && output.getValue().isGreaterThan(feeRaise)) { outputToSpend = output; break; } } // TODO spend another confirmed output of own wallet if needed checkNotNull(outputToSpend, "Can't find adequately sized output that spends to us"); final Transaction tx = new Transaction(parentTransaction.getParams()); tx.addInput(outputToSpend); tx.addOutput(outputToSpend.getValue().subtract(feeRaise), wallet.freshAddress(KeyPurpose.CHANGE)); tx.setPurpose(Transaction.Purpose.RAISE_FEE); final SendRequest req = forTx(tx); req.completed = true; return req; }
if (output.getMinNonDustValue().isGreaterThan(output.getValue())) { throw new CouldNotAdjustDownwards(); if (change.isGreaterThan(Coin.ZERO)) {
@Test public void testOperators() { assertTrue(SATOSHI.isPositive()); assertFalse(SATOSHI.isNegative()); assertFalse(SATOSHI.isZero()); assertFalse(NEGATIVE_SATOSHI.isPositive()); assertTrue(NEGATIVE_SATOSHI.isNegative()); assertFalse(NEGATIVE_SATOSHI.isZero()); assertFalse(ZERO.isPositive()); assertFalse(ZERO.isNegative()); assertTrue(ZERO.isZero()); assertTrue(valueOf(2).isGreaterThan(valueOf(1))); assertFalse(valueOf(2).isGreaterThan(valueOf(2))); assertFalse(valueOf(1).isGreaterThan(valueOf(2))); assertTrue(valueOf(1).isLessThan(valueOf(2))); assertFalse(valueOf(2).isLessThan(valueOf(2))); assertFalse(valueOf(2).isLessThan(valueOf(1))); }
.isGreaterThan(txCoin.getOutput(0).getValue().multiply(txCoin.getConfidence().getDepthInBlocks())));