add fee rate retreival to blocktransaction

This commit is contained in:
Craig Raw 2022-07-20 16:54:39 +02:00
parent f10688279a
commit b4b2534e7a

View file

@ -53,6 +53,15 @@ public class BlockTransaction extends BlockTransactionHash implements Comparable
return Collections.unmodifiableSet(funding);
}
public Double getFeeRate() {
if(getFee() != null && transaction != null) {
double vSize = transaction.getVirtualSize();
return getFee() / vSize;
}
return null;
}
@Override
public int compareTo(BlockTransaction blkTx) {
int blockOrder = compareBlockOrder(blkTx);