Merge pull request #3785 from mempool/mononaut/mined-block-rbf

Detect RBF by mined transactions
This commit is contained in:
softsimon
2023-05-30 14:50:07 +07:00
committed by GitHub
4 changed files with 59 additions and 1 deletions

View File

@@ -332,6 +332,8 @@ class WebsocketHandler {
for (const deletedTx of deletedTransactions) {
rbfCache.evict(deletedTx.txid);
}
memPool.removeFromSpendMap(deletedTransactions);
memPool.addToSpendMap(newTransactions);
const recommendedFees = feeApi.getRecommendedFee();
// update init data
@@ -600,6 +602,10 @@ class WebsocketHandler {
}
}
const rbfTransactions = Common.findMinedRbfTransactions(transactions, memPool.getSpendMap());
memPool.handleMinedRbfTransactions(rbfTransactions);
memPool.removeFromSpendMap(transactions);
// Update mempool to remove transactions included in the new block
for (const txId of txIds) {
delete _memPool[txId];