- Does it work one thing like this?
No, probably not.
generateblock
is a testing solely RPC that truly mines a block utilizing the interior CPU miner, itt doesn’t make a block template. So it is utterly irrelevant to this.
There are mainly two methods of inserting a transaction:
- The miner would put the transaction in their very own mempool (and presumably find yourself broadcasting it) through the use of
sendrawtransaction
. Then they might useprioritisetransaction
to artificially set the transaction’s charge so that it’s going to seem in a block template generated bygetblocktemplate
. - They’re utilizing some exterior block template generator that may do the insertion itself. This software program might start with a block template created by
getblocktemplate
, but it surely must additionally implement a whole lot of the block meeting code itself to confirm that the template it finally ends up producing is legitimate.
- I think about the node software program is continually updating the block to maximise the quantity of charges acquired. Does it imply it overrides the transaction I added manually?
In the event that they used methodology 1, no there wouldn’t be any overriding of the handbook transaction since bitcoind remembers the modified charge and can proceed to account for it till that transaction is confirmed.
For methodology 2, the exterior template software program is doing the insertion so it’ll keep in mind. That exterior software program might even be (re)constructing the template anyhow, so it is mainly what bitcoind is doing in methodology 1.
- Is there some UI that permits you to do that? E.g. shows the present block template + transactions in mempool and permits you to exchange transaction in a block template with transaction from the mempool? If not, I would try and construct one thing in that style.
I do not suppose there are any such software program that’s publicly accessible. Nowadays, block templates are produced by swimming pools, and these swimming pools typically use customized software program, so they could have tooling that does this. However it will not be accessible to the general public.