1

I have a bitcoind running on a server behind the www box which I poll every minute for new transactions and save new data into a table.

Something strange is happening sometimes. If i send 1 btc from my wallet to an address on the bitcoind server, it gets through just fine and shows up right away in the log when downloading transactions via RPC.

If however I send from an exchange, it does not show up (at least not for a day or two). I've noticed that these exchanges add another address and amount to the same txid, could that be the cause?

Is there a workaround for this?

TIA

4
  • Should you be polling for new transactions? bitcoin.stackexchange.com/questions/12380/…
    – John T
    Jan 25, 2014 at 3:26
  • Probably not, the only reason for doing this is that I keep btcoind separate from everything else on a different server with no access to my databases or anything else (for security reasons)... so RPC was the most viable option. But I'll try using that notification thing. Although if someone hacks this bitcoind thing they will be able to inject transactions into my database.
    – Nick M
    Jan 25, 2014 at 12:31
  • Check the btc hashes when processing em to avoid any security problems. But you can still get ruined if your bitcoind gets "hacked".
    – John T
    Jan 25, 2014 at 22:08
  • Had to drop all the old code and use walletnotify. if someone else goes for this, remember to check for duplicates as you can get several hits from the notification thing for each transaction. jtorba if you post your comment as answer I can click the green thing
    – Nick M
    Jan 29, 2014 at 17:12

1 Answer 1

0

Use walletnotify instead of polling.

how to do address callbacks?

It's basically a argument you can specify and Bitcoin will the specified program upon receiving a transaction (BOTH receives and sends from an address in wallet get notified). So you just setup a small script to run and point to it in bitcoin.conf.

Be sure to check for duplicates as walletnotify sends notifications for when a txn is first received (unconfirmed) and when it receives a confirmation.

Also blocknotify does the same thing as walletnotify but for blocks, may be useful for checking unconfirmed transactions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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