Hello,
I want to make a similar function like Blockchain's receive payments API but with my own Bitcoin server (
https://blockchain.info/api/api_receive). It should generate a new Bitcoin address for the user and if they send the BTC to that address it will notify the user of the amount of confirmations. When the transaction has 6 confirmations then notify the user and move the received Bitcoins to the main account. They can also use the same Bitcoin address again.
I was thinking of this:
1. Generate a Main Bitcoin address for the application and label it.
2. Generate a Bitcoin address for the user: getnewaddress(account=UniqueUserID)
3. In a 5min cronjob check all the transactions for the User's Bitcoin accounts and if an account receives BTC than store the amount&transactionID and the account etc.: listtransactions()
4. In the same cronjob check for confirmations and notify it to the user: gettransaction(TransactionID)
5. If there are 6 confirmations then notify the user and move the received Bitcoins to the main account: move(UniqueUserID, MainBTCAccount, ReceivedBitcoins, minconf=6, comment='Transaction from:'.UniqueUserID)
So will this work?
And do I need a cronjob in step 5? or is one time calling the move command enough?
Thanks in advance!