MultiversX Tracker is Live!

What is the purpose of indexing transactions in mempool by these 5 criteria?

Bitcoin Stack Exchange

Bitcoin News / Bitcoin Stack Exchange 173 Views

In bitcoin source code in this file, comment says that unconfirmed transactions are indexed by 5 criteria.

 * mapTx is a boost::multi_index that sorts the mempool on 5 criteria: * - transaction hash (txid) * - witness-transaction hash (wtxid) * - descendant feerate [we use max(feerate of tx, feerate of tx with all descendants)] * - time in mempool * - ancestor feerate [we use min(feerate of tx, feerate of tx with all unconfirmed ancestors)]

I can understand why would we need to index transactions by the time they are in the mempool. But I can't understand the need for sorting them based on txid and wtxid (while they are hash output, so they are like random numbers, why bother to index them?). And also I don't understand the the meaning of descendant feerate and ancestor feerate. The simple concept I can deduce is that miners are willing to put transactions with higher fee rates in their block, so sorting based on simple fee rate make sense to me, but why sorting based on parents and children of a transaction?


Get BONUS $200 for FREE!

You can get bonuses upto $100 FREE BONUS when you:
πŸ’° Install these recommended apps:
πŸ’² SocialGood - 100% Crypto Back on Everyday Shopping
πŸ’² xPortal - The DeFi For The Next Billion
πŸ’² CryptoTab Browser - Lightweight, fast, and ready to mine!
πŸ’° Register on these recommended exchanges:
🟑 Binance🟑 Bitfinex🟑 Bitmart🟑 Bittrex🟑 Bitget
🟑 CoinEx🟑 Crypto.com🟑 Gate.io🟑 Huobi🟑 Kucoin.



Comments