Bugfix: Don't extend already extended transactions to not override the firstSeen property.

fixes #390
This commit is contained in:
softsimon committed 2021-03-19 19:10:11 +07:00
1 parent 5148de8f17
commit e688948e42
1 file changed
+5
+5
View File
@@ -26,6 +26,11 @@ class TransactionUtils {
}
private extendTransaction(transaction: IEsploraApi.Transaction): TransactionExtended {
// @ts-ignore
if (transaction.vsize) {
// @ts-ignore
return transaction;
}
const feePerVbytes = Math.max(1, (transaction.fee || 0) / (transaction.weight / 4));
const transactionExtended: TransactionExtended = Object.assign({
vsize: Math.round(transaction.weight / 4),