Handle coinbase transactions no longer has undefined fee.

This commit is contained in:
softsimon
2020-07-24 00:20:59 +07:00
parent 9d8c1184ab
commit 9980414969
4 changed files with 7 additions and 4 deletions

View File

@@ -12,7 +12,7 @@ export class Common {
return medianNr;
}
static getFeesInRange(transactions: TransactionExtended[], rangeLength: number, lastindex = 0) {
static getFeesInRange(transactions: TransactionExtended[], rangeLength: number) {
const arr = [transactions[transactions.length - 1].feePerVsize];
const chunk = 1 / (rangeLength - 1);
let itemsToAdd = rangeLength - 2;
@@ -22,7 +22,7 @@ export class Common {
itemsToAdd--;
}
arr.push(transactions[lastindex].feePerVsize);
arr.push(transactions[0].feePerVsize);
return arr;
}