CPFP support (#395)

* CPFP support.

fixes #5
fixes #353
fixes #360

* Use effectiveFeePerVsize for mempool statistics.

* Renaming endpoint cpfp-info to just cpfp.

* Renaming decended to BestDescendant.

* Updating language file with new strings.
This commit is contained in:
softsimon
2021-03-18 23:47:40 +07:00
committed by GitHub
parent f633adef84
commit 58402c008f
19 changed files with 487 additions and 289 deletions

View File

@@ -26,9 +26,11 @@ class TransactionUtils {
}
private extendTransaction(transaction: IEsploraApi.Transaction): TransactionExtended {
const feePerVbytes = Math.max(1, (transaction.fee || 0) / (transaction.weight / 4));
const transactionExtended: TransactionExtended = Object.assign({
vsize: Math.round(transaction.weight / 4),
feePerVsize: Math.max(1, (transaction.fee || 0) / (transaction.weight / 4)),
feePerVsize: feePerVbytes,
effectiveFeePerVsize: feePerVbytes,
}, transaction);
if (!transaction.status.confirmed) {
transactionExtended.firstSeen = Math.round((new Date().getTime() / 1000));