Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Updated min and max fees for floating fees

  • Loading branch information...
greenaddress committed Feb 25, 2015
1 parent 933c29c commit 2da72b1c2946c2a6f3486a3f3477eec18de7efa1
@@ -1252,12 +1252,12 @@ public Coin apply(@Nullable List<Boolean> input) {
outValue = outValue.add(out.getValue());
}
final Coin fee = inValue.subtract(outValue);
if (fee.compareTo(Coin.valueOf(10000)) == -1) {
throw new IllegalArgumentException("Verification: Fee is too small (expected at least 10000 satoshi).");
if (fee.compareTo(Coin.valueOf(1000)) == -1) {
throw new IllegalArgumentException("Verification: Fee is too small (expected at least 1000 satoshi).");
}
int kB = (transaction.decoded.getMessageSize() + 999) / 1000;
if (fee.compareTo(Coin.valueOf(kB * 20000)) == 1) {
throw new IllegalArgumentException("Verification: Fee is too large (expected at most 20000 satoshi per kB).");
int kBfee = (int)(500000.0 * ((double)transaction.decoded.getMessageSize()) / 1000.0);
if (fee.compareTo(Coin.valueOf(kBfee)) == 1) {
throw new IllegalArgumentException("Verification: Fee is too large (expected at most 500000 satoshi per kB).");
}
return fee;
}

0 comments on commit 2da72b1

Please sign in to comment.
You can’t perform that action at this time.