user17120: I am messing with the Bitcoin sourcecode. 
Normally when you want to send some BTC you type :
./bitcoind sendtoaddress 1ADRESSS 0.001 

How would you do this in the sourcecode on a recurring basis? 
So what code is needed to send a transaction to a specified address each time a block is created? Almost like a tax. and where would this code be placed? 
I am learning the Inside of the Bitcoin protocol and C++ so any help would be great. 

user-1: You can make use of the -blocknotify=<cmd> facility as described under: https://en.bitcoin.it/wiki/Running_Bitcoin.
This is a nice example of how to use -walletnotify: https://bitcoin.stackexchange.com/a/24483/11221, -blocknotify can be configured in exactly the same way.

17120: <p>I am messing with the Bitcoin sourcecode. </p>

<p>Normally when you want to send some BTC you type :</p>

<pre><code>./bitcoind sendtoaddress 1ADRESSS 0.001 
</code></pre>

<p>How would you do this in the sourcecode on a recurring basis? </p>

<p>So what code is needed to send a transaction to a specified address each time a block is created? Almost like a tax. and where would this code be placed? </p>

<p>I am learning the Inside of the Bitcoin protocol and C++ so any help would be great. </p>
 -1: <p>You can make use of the <code>-blocknotify=&lt;cmd&gt;</code> facility as described under: <a href="https://en.bitcoin.it/wiki/Running_Bitcoin" rel="nofollow noreferrer">https://en.bitcoin.it/wiki/Running_Bitcoin</a>.</p>

<p>This is a nice example of how to use <code>-walletnotify</code>: <a href="https://bitcoin.stackexchange.com/a/24483/11221">https://bitcoin.stackexchange.com/a/24483/11221</a>, <code>-blocknotify</code> can be configured in exactly the same way.</p>
