3
1
I understand it's in the miner's best interest to receive as many fees as possible for his hopefully-accepted block, hence it should include the most rewarding (fee / size) txs - up to the 1MB limit.
However, what algorithm do the miners use? It seems like a knapsack problem, which is NP-Hard, so I doubt miners actually go for the optimal solution.
Thanks!
Great, thanks. Where can I find the code that implements this behavior? – Itay – 2017-11-02T12:22:24.010
somewhere in https://github.com/bitcoin/bitcoin (cy, Captain Obvious)
– amaclin – 2017-11-02T12:43:14.2171this isnt the full truth, and miners likely differ in their implementations. one way to prove this isnt the full truth is to look at the existence of transactiln accelerators, another to look at blocks with 0 transactions and a third to look at blocks with some transaction types excluded. – Jonathan Silverblood – 2017-11-03T07:22:41.167