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?
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