2

When monitoring incoming transactions for a web wallet, should I check for confirmations on a timer, e.g. every minute? Or should I check once every block by using blocknotify?

2

Every 30-60 seconds should be sufficient, but if you have access to a service that will notify you when blocks are found, that would be the fastest. A confirmation is just a block being found. Once the transaction is included in a block, that's its first confirmation (and it is no longer unconfirmed). Every block that stems from that block afterward is another confirmation.

  • 1
    Well this was kinda my thought. bitcoind uses the blocknotify config parameter to notify you on every block, so is there any need to check more than once per block? – Avram Mar 17 '14 at 11:19
  • 4
    No, a block is a confirmation. Therefore it's impossible for a confirmation to happen between blocks. – Dr. McKay Mar 17 '14 at 13:02
2

This is a nice chart on the average transaction confirmation time: https://blockchain.info/charts/avg-confirmation-time that will give you a better estimation on how often you should check.

Also related: What keeps the average block time at 10 minutes?

  • I guess what I want to ask is this - given that bitcoind can notify me when a new block is received, is there any point checking more than once per block? – Avram Mar 17 '14 at 11:22
  • @George, Did the chart at blockchain.info/charts/avg-confirmation-time really sample all transactions? Or do they only sample like 1 transaction per day? – Pacerier May 23 '14 at 14:33
2

It depends how quickly you would like to notify the customer of their payment being accepted. When I make a deposit/payment, I would like to see it as soon as possible. I always get that uneasy feeling during the time between when I send coins and when I see it confirm in my account.

If I were you I would say every minute is acceptable (and easy to set up a cron for), I would notify when the payment has been seen (rawmempool), and when it has been confirmed the required amount of times to send or spend.

  • 1
    I guess what I want to ask is this - given that bitcoind can notify me when a new block is received, is there any point checking more than once per block? – Avram Mar 17 '14 at 11:20
  • If you would like to check for new unconfirmed transactions, yes, otherwise it would not be needed. I like seeing that my deposit was accepted asap, but truth be told this is not critical for payment processing. If you'd like to notify your customers that you have seen their payment sooner, then you can write a cron; if you just want to notify them their payment has been processed block notify should do the trick. Either way, the user will get used to how you process transactions. If you go with using block notify only you should expect clients to send you emails while they wait. – Mark Mar 17 '14 at 17:14
  • Thanks Mark. I use the walletnotify option to pick up transactions as soon as they are broadcast, and there doesn't seem to be any point in checking more than once per block. Think I have my way forward :) – Avram Mar 18 '14 at 2:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.