From b2297a8d0219af70b3e97c83feb1af8aec485d9f Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Fri, 25 Sep 2020 15:36:40 +0200 Subject: [PATCH] add fee rate support --- .../com/sparrowwallet/drongo/wallet/WalletTransaction.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/sparrowwallet/drongo/wallet/WalletTransaction.java b/src/main/java/com/sparrowwallet/drongo/wallet/WalletTransaction.java index b183f33..808af42 100644 --- a/src/main/java/com/sparrowwallet/drongo/wallet/WalletTransaction.java +++ b/src/main/java/com/sparrowwallet/drongo/wallet/WalletTransaction.java @@ -82,6 +82,10 @@ public class WalletTransaction { return fee; } + public double getFeeRate() { + return (double)fee / transaction.getVirtualSize(); + } + public long getTotal() { return selectedUtxos.keySet().stream().mapToLong(BlockTransactionHashIndex::getValue).sum(); }