Why does getblocktemplate use priority for transaction selection? I don't know how getblocktemplate works exactly, but it seems to include transactions based on priority.

Selecting transactions based on priority isn't the most profitable method for building a block (as opposed to fee/byte), so is getblocktemplate only going to be used by miners who haven't figured out how to construct their own blocks?

Why would anyone use getblocktemplate otherwise?


Bitcoin transaction priority calculation
https://github.com/bitcoin/bitcoin/blob/86b800c6a299455580fe76e5fb43218f0222e179/src/miner.cpp
Getblocktemplate builds a block based on configuration parameters. In recent versions, the default is to use fee per byte as criterion for the entire block.

History

In versions of Bitcoin up to 0.6, priority based selection was used for the entire block. It was a means to encourage the young Bitcoin economy to grow. However, it also had a minimum transaction fee that increased as the space in blocks grew closer to the limit.

In version 0.7 the -blockprioritysize setting was introduced, which divided blocks in a priority area and a fee area. The priority area was there to support a small number of low-fee transactions to continue, and was limited to 27 kB by default (50 kB since version 0.9). The fee area is sorted by fee per byte, and maximizes total fees for miners.

Recent versions

In Bitcoin Core 0.12 the default setting for the priority size was reduced to 0. It also introduced a more efficient algorithm for selecting transactions, which works suboptimally for the priority area.

In the upcoming Bitcoin Core 0.13 release the algorithm selection algorithm will be improved again and use Child-pays-for-parent (CPFP) logic. This logic uses fees from unconfirmed descendant transactions to determine whether to include parents. It increases the total fees that can be taken compared to the previous algorithm, and allows wallets to increase fees on a transaction by spending its change outputs with higher fee.