Bitcoin Transaction within source code 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.
You can make use of the -blocknotify=&lt;cmd&gt; 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.