I am sending bitcoin transaction in node js via
I realized that when i call the function
.broadcast to send the transaction to network and returns value, it means that the transaction is broadcasted but not completed.
What I want to ensure that when the transaction is in bitcoin network , I will need to write the status into local database (pending, success or fail).
I am thinking of looping and keep calling the transaction detail by txid until it is completed only it write to database. But thinking that bitcoin network transaction will take up to 30 minutes it might not be a good approach because the node server might take up a lot of resources in keep querying the transaction detail.
Any idea on what's the best practice to ensure that local database transaction detail and status in sync with the bitcoin network?
And what function should i use to get transaction detail? I seems to not able to find query of transaction detail in bitcore library.