This question is not a duplicate of Can miners choose which transactions to mine?

Everybody seems to agree on the fact that miners can select which transactions they are mining. But I can't find a way to do it! I created a personal bitcoin network (testnet protocol) where I'm the only miner. I send transactions to my several (fake) nodes and get them all in the mempool.

For demonstration purposes, I want some of the transactions (with high fees) to be includeed in the first block and the rest in the second one. I tried to use prioritisetransaction (with my miner node) to do this but all the transactions went to the same block:

bitcoin-cli prioritisetransaction txId1 5000 200

bitcoin-cli prioritisetransaction txId2 0 -200

I put arbitrary values, the goal is to mine Tx1 in the first block and Tx2 in the second or even after. How can I create such a behavior? Do I really need to put more than 1000 transactions to see my transactions going in different blocks?

I will welcome any help, thank you in advance.

EDIT: I'm adding a question to this post. On another lead to find a way to "choose" in wich block my transaction will be included I tried "estimatefee/priority" calls. In my private bitcoin network (height: 14.000 blocks) when I call:

bitcoin-cli estimatefee X

whatever X (number of block before inclusion), the answer is "-1" which means that the network cannot estimate what I'm asking (should only append for high digits). Do I need more blocks in my Blockchain? More transactions? Same experiment in the real testnet, estimatefee works but is really far from the reality and whatever the fee, all my transactions go to the first block.

  • I found this discussion also, but nobody really answers the actual question: bitcoin.stackexchange.com/questions/7311/… – Hugo Borne Jun 16 '15 at 12:49
  • Have you tried prioritisetransaction txid2 -1000000 -1000000 ? – Nick ODell Jun 16 '15 at 16:22
  • I tried : bitcoin-cli prioritisetransaction txId1 1000000 1000000 bitcoin-cli prioritisetransaction txId2 -1000000 -1000000 without success – Hugo Borne Jun 17 '15 at 7:58
  • the function estimatefee basically returns an ordered statistics overs the at most 100 times 25 = 2500 transactions. If you don't have enough txs in your blockchain, it cannot perform this sort of calculation. – clemlaflemme Oct 13 '15 at 8:50

Do I really need to put more than 1000 transactions [in a block] to see my transactions going in different blocks

No. You can limit the size of the blocks you produce by changing the -blockmaxsize option. For example, if you only want to be able to add a single 250-byte transaction plus the 80-byte header and 1-byte (in this case) transaction count, you can start Bitcoin Core like this:

bitcoind -testnet -daemon -blockmaxsize=331

Then you can use the prioritisetransaction RPC to prioritize tx1 over tx2.

Regarding your second question, estimatefee and estimatepriority may not return useful results on testnet because transaction volume there is low so almost every transaction goes into the next block.

You may find it more useful to experiment with regression test mode which will allow you to create a private testing network and completely control every block (as well as mine blocks instantly).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.