user126732: Where are the rewards sent when using the submitblock function in the case the block is okay?

user208: The payout address that subsidy/fees are sent to is part of the block itself. The very first transaction in every block is called the coinbase transaction. This coinbase transaction has no inputs (it implicitly receives the subsidy and fees of the block) and its outputs define where these new coins are sent to.
So the answer is simply: the rewards are sent wherever the block says they go. This has to be decided before submitblock is invoked. In fact, it has to be decided before mining can even start: as the coinbase is part of the block, modifying it would invalidate the block's proof of work. This also prevents other parties on the network from changing the block to pay them instead.

126732: <p>Where are the rewards sent when using the <code>submitblock</code> function in the case the block is okay?</p>
 208: <p>The payout address that subsidy/fees are sent to is part of the block itself. The very first transaction in every block is called the coinbase transaction. This coinbase transaction has no inputs (it implicitly receives the subsidy and fees of the block) and its outputs define where these new coins are sent to.</p>
<p>So the answer is simply: the rewards are sent wherever the block says they go. This has to be decided before <code>submitblock</code> is invoked. In fact, it has to be decided before mining can even start: as the coinbase is part of the block, modifying it would invalidate the block's proof of work. This also prevents other parties on the network from changing the block to pay them instead.</p>
