2
I want to have a server running that will be processing payments and refunds. However, I also want to ensure that should my server die, that after a restart I will continue sending out any applicable refunds without sending a refund to someone I have already sent one too. I plan on using a WAL to achieve this, but I need to know what to store in the WAL. Is it possible to know your transaction ID before submitting the transaction?
That way I could just log the ID before submitting, and if I crash, I can just check the blockchain to see if that transaction already exists or not.
This seems like it would be a common problem for payment processors, but looking at the JSON-RPC documentation it appears that you only ever get the transaction ID after submitting the sendfrom/sendtoaddress.
I suspect this can be achieved by creating a raw tx, then storing that in the WAL before attempting to send the tx. Then, after a crash, I can verify which transactions are in the blockchain and which aren't, but I dont know if this is the best way or not. – senecaso – 2013-06-13T13:21:32.900