match coldcard fee percent calc

This commit is contained in:
Craig Raw 2020-08-20 12:29:50 +02:00
parent b1299f6abf
commit 9663629e34

View file

@ -86,8 +86,12 @@ public class WalletTransaction {
return selectedUtxos.keySet().stream().mapToLong(BlockTransactionHashIndex::getValue).sum();
}
/**
* Fee percentage matches the Coldcard implementation of total fee as a percentage of total value out
* @return the fee percentage
*/
public double getFeePercentage() {
return (double)getFee() / getTotal();
return (double)getFee() / (getTotal() - getFee());
}
public boolean isCoinControlUsed() {