From 663bba987438b675a3bdd5e160d42024ca543f8d Mon Sep 17 00:00:00 2001 From: pie <429224280@qq.com> Date: Tue, 11 Aug 2020 00:04:03 +0800 Subject: [PATCH] update --- .../tokencore/wallet/transaction/BitcoinTransaction.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/consenlabs/tokencore/wallet/transaction/BitcoinTransaction.java b/src/main/java/org/consenlabs/tokencore/wallet/transaction/BitcoinTransaction.java index 610718b..6a2da2f 100755 --- a/src/main/java/org/consenlabs/tokencore/wallet/transaction/BitcoinTransaction.java +++ b/src/main/java/org/consenlabs/tokencore/wallet/transaction/BitcoinTransaction.java @@ -63,12 +63,13 @@ public BitcoinTransaction(List multiToList, int changeIdx, long fee, Ar this.outputs = outputs; this.changeIdx = changeIdx; multiToList.forEach(multiTo -> { + if (multiTo.getAmount() < DUST_THRESHOLD) { + throw new TokenException(Messages.AMOUNT_LESS_THAN_MINIMUM); + } multiToAmount += multiTo.getAmount(); }); - if (amount < DUST_THRESHOLD) { - throw new TokenException(Messages.AMOUNT_LESS_THAN_MINIMUM); - } + } @Override