Skip to content
This repository was archived by the owner on Mar 20, 2019. It is now read-only.

Commit 2da72b1

Browse files
author
GreenAddress
committed
Updated min and max fees for floating fees
1 parent 933c29c commit 2da72b1

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed
Binary file not shown.

app/src/main/java/com/greenaddress/greenbits/GaService.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,12 +1252,12 @@ public Coin apply(@Nullable List<Boolean> input) {
12521252
outValue = outValue.add(out.getValue());
12531253
}
12541254
final Coin fee = inValue.subtract(outValue);
1255-
if (fee.compareTo(Coin.valueOf(10000)) == -1) {
1256-
throw new IllegalArgumentException("Verification: Fee is too small (expected at least 10000 satoshi).");
1255+
if (fee.compareTo(Coin.valueOf(1000)) == -1) {
1256+
throw new IllegalArgumentException("Verification: Fee is too small (expected at least 1000 satoshi).");
12571257
}
1258-
int kB = (transaction.decoded.getMessageSize() + 999) / 1000;
1259-
if (fee.compareTo(Coin.valueOf(kB * 20000)) == 1) {
1260-
throw new IllegalArgumentException("Verification: Fee is too large (expected at most 20000 satoshi per kB).");
1258+
int kBfee = (int)(500000.0 * ((double)transaction.decoded.getMessageSize()) / 1000.0);
1259+
if (fee.compareTo(Coin.valueOf(kBfee)) == 1) {
1260+
throw new IllegalArgumentException("Verification: Fee is too large (expected at most 500000 satoshi per kB).");
12611261
}
12621262
return fee;
12631263
}

0 commit comments

Comments
 (0)