keep cached RBF info for 24 hours after tx leaves the mempool

This commit is contained in:
Mononaut
2022-12-09 14:35:51 -06:00
parent 0481f57304
commit d778530620
4 changed files with 37 additions and 37 deletions

View File

@@ -58,10 +58,10 @@ class WebsocketHandler {
client['track-tx'] = parsedMessage['track-tx'];
// Client is telling the transaction wasn't found
if (parsedMessage['watch-mempool']) {
const rbfCacheTx = rbfCache.getReplacedBy(client['track-tx']);
if (rbfCacheTx) {
const rbfCacheTxid = rbfCache.getReplacedBy(client['track-tx']);
if (rbfCacheTxid) {
response['txReplaced'] = {
txid: rbfCacheTx.txid,
txid: rbfCacheTxid,
};
client['track-tx'] = null;
} else {
@@ -467,6 +467,7 @@ class WebsocketHandler {
for (const txId of txIds) {
delete _memPool[txId];
removed.push(txId);
rbfCache.evict(txId);
}
if (config.MEMPOOL.ADVANCED_GBT_MEMPOOL) {