0
I am building a website which involves in the processing of transactions of BTC. My current and most efficient plan to complete this would be to call these bitcoin-cli commands and process the data accordingly:
getblockcount - get block height
getblockhash blockheight-5 - get the block hash for the last 5 blocks
listsinceblock blockhash - list all transactions since then
I would run this order of commands every 5-10 seconds. I would like to know if this method wont screw me over at all (skipping transactions, etc). I might just be too paranoid about clients not getting what they paid for and just want a guaranteed method that no transactions slip by. I was hoping to call a method that can list all transactions since a certain time but that wasn't available. Now to the question:
Is this method CPU/Network intensive?
Is it a safe method?
What are my alternatives?
If you are getting the last 5 blocks and logging all transactions since then, why would you run this every 5-10 seconds?
I think you'd be safe running it every N minutes.
Are you storing this in a database? – m1xolyd1an – 2016-12-13T03:18:32.943
It's possible, though unlikely, that more than 5 blocks could be mined in those 5-10 seconds. – Nate Eldredge – 2016-12-13T04:40:04.153
Despite that probability, I'd rather not take that risk. – Monstrum – 2016-12-13T04:53:19.567
Please edit the title to summarize your question's topic. – Murch – 2017-01-13T17:04:53.280