Refactoring: Replace isGreaterThan(Coin.ZERO) with isPositive()

This commit is contained in:
chimp1984 2019-12-01 18:34:58 -05:00 committed by Christoph Atteneder
parent fdc582a60e
commit 04c02589aa
No known key found for this signature in database
GPG key ID: CD5DC1C529CDFD3B

View file

@ -926,10 +926,10 @@ public class TradeWalletService {
TransactionOutput p2SHMultiSigOutput = depositTx.getOutput(0); TransactionOutput p2SHMultiSigOutput = depositTx.getOutput(0);
Transaction payoutTx = new Transaction(params); Transaction payoutTx = new Transaction(params);
payoutTx.addInput(p2SHMultiSigOutput); payoutTx.addInput(p2SHMultiSigOutput);
if (buyerPayoutAmount.isGreaterThan(Coin.ZERO)) { if (buyerPayoutAmount.isPositive()) {
payoutTx.addOutput(buyerPayoutAmount, Address.fromBase58(params, buyerAddressString)); payoutTx.addOutput(buyerPayoutAmount, Address.fromBase58(params, buyerAddressString));
} }
if (sellerPayoutAmount.isGreaterThan(Coin.ZERO)) { if (sellerPayoutAmount.isPositive()) {
payoutTx.addOutput(sellerPayoutAmount, Address.fromBase58(params, sellerAddressString)); payoutTx.addOutput(sellerPayoutAmount, Address.fromBase58(params, sellerAddressString));
} }
@ -989,10 +989,10 @@ public class TradeWalletService {
Sha256Hash spendTxHash = Sha256Hash.wrap(depositTxHex); Sha256Hash spendTxHash = Sha256Hash.wrap(depositTxHex);
payoutTx.addInput(new TransactionInput(params, depositTx, p2SHMultiSigOutputScript.getProgram(), new TransactionOutPoint(params, 0, spendTxHash), msOutput)); payoutTx.addInput(new TransactionInput(params, depositTx, p2SHMultiSigOutputScript.getProgram(), new TransactionOutPoint(params, 0, spendTxHash), msOutput));
if (buyerPayoutAmount.isGreaterThan(Coin.ZERO)) { if (buyerPayoutAmount.isPositive()) {
payoutTx.addOutput(buyerPayoutAmount, Address.fromBase58(params, buyerAddressString)); payoutTx.addOutput(buyerPayoutAmount, Address.fromBase58(params, buyerAddressString));
} }
if (sellerPayoutAmount.isGreaterThan(Coin.ZERO)) { if (sellerPayoutAmount.isPositive()) {
payoutTx.addOutput(sellerPayoutAmount, Address.fromBase58(params, sellerAddressString)); payoutTx.addOutput(sellerPayoutAmount, Address.fromBase58(params, sellerAddressString));
} }