Validate a payment using bitcoind and json rpc

3

I need to implement a BTC payment system on my web-store. But I'm still not sure about the mechanisms I'm supposed to use for payment confirmation.

For example, a user registered on my store and I created a new address for his account by using getnewaddress('user-name'). I also generate a new address for every new transaction. How can I track the status of a payment made to this address?

Александр Пушкин

Posted 2015-12-17T16:25:35.993

Reputation: 131

Answers

1

I would start by looking at the mempool. See getrawmempool, getrawtransaction, decoderawtransaction api calls. Once you see the transaction your looking for in the mempool you could consider that status #1

Once this transaction is confirmed in a block it will show up as part of the getbalance for that account and other RPC calls like listunspent etc.. You could consider that status #2

Then it's up to you how many confirmations you want for the payment to be considered confirmed.

Dustin Butler

Posted 2015-12-17T16:25:35.993

Reputation: 461