Limit GBT - calculate purged tx cpfp on demand

This commit is contained in:
Mononaut
2024-01-05 22:25:07 +00:00
parent e2d3bb4cc5
commit 62653086e9
6 changed files with 303 additions and 14 deletions

View File

@@ -33,6 +33,7 @@ interface AddressTransactions {
removed: MempoolTransactionExtended[],
}
import bitcoinSecondClient from './bitcoin/bitcoin-second-client';
import { calculateCpfp } from './cpfp';
// valid 'want' subscriptions
const wantable = [
@@ -702,6 +703,9 @@ class WebsocketHandler {
accelerated: mempoolTx.acceleration || undefined,
}
};
if (!mempoolTx.cpfpChecked) {
calculateCpfp(mempoolTx, newMempool);
}
if (mempoolTx.cpfpDirty) {
positionData['cpfp'] = {
ancestors: mempoolTx.ancestors,