Bitcoin Forum
May 10, 2024, 06:03:21 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Should I use Blocknotify to update my unconfirmed transactions?  (Read 993 times)
jlp (OP)
Sr. Member
****
Offline Offline

Activity: 266
Merit: 264


View Profile
February 04, 2014, 01:54:24 AM
Last edit: February 04, 2014, 03:18:59 AM by jlp
 #1

I'm trying to integrate and accept Bitcoin on my web app.

I'm using Bitcoin's walletnotify to tell me if a customer has sent Bitcoins to the address that I provided him/her.  Then I call the "gettransaction" RPC call to the Bitcoin API to get the transaction ID and unconfirmed amount and store this with the address into my database.  Then I'm using Bitcoin's blocknotify to prompt me when maybe one or more of my unconfirmed transactions might be confirmed (6? times).  When I get a blocknotify, I will find all of the transactions in my database that are unconfirmed and then use "gettransaction" to get the number of confirmations for those transactions.

I found out, through the "getblock" RPC call to the Bitcoin API, that the block will include many transactions that did not send to nor receive Bitcoins from my wallet.  With the array of transactions returned from "getblock", I called "gettransaction" on those transactions.  I got the following error on many of these transactions:

error: {"code":-5,"message":"Invalid or non-wallet transaction id"}

According to the following posting, this means those transactions are not involved with my wallet:

https://bitcointalk.org/index.php?topic=100824.0

This makes me think that blocknotify will pompt me thousands or hundreds of thousands of times, as there must be millions of transactions on the Bitcoin network that are unrelated to my wallet.  Am I correct?  If so, this doesn't seem that blocknotify is a viable method to update the confirmations on my transactions.

Did anyone use this method and if so, did your server spent a lot of resources in processing blocknotifies?  What is a better way to update the transaction confirmations?  If there a way to use blocknotify or something else from Bitcoin-QT/bitcoind?
1715321001
Hero Member
*
Offline Offline

Posts: 1715321001

View Profile Personal Message (Offline)

Ignore
1715321001
Reply with quote  #2

1715321001
Report to moderator
1715321001
Hero Member
*
Offline Offline

Posts: 1715321001

View Profile Personal Message (Offline)

Ignore
1715321001
Reply with quote  #2

1715321001
Report to moderator
BitcoinCleanup.com: Learn why Bitcoin isn't bad for the environment
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715321001
Hero Member
*
Offline Offline

Posts: 1715321001

View Profile Personal Message (Offline)

Ignore
1715321001
Reply with quote  #2

1715321001
Report to moderator
1715321001
Hero Member
*
Offline Offline

Posts: 1715321001

View Profile Personal Message (Offline)

Ignore
1715321001
Reply with quote  #2

1715321001
Report to moderator
M1SHO
Sr. Member
****
Offline Offline

Activity: 258
Merit: 250


View Profile
March 14, 2014, 01:46:22 AM
 #2

Did you found any solution ? I'm also working on something similar for litecoin.

The World's First Gold-Backed Crypto Currency INNcoin - http://4thjulycoin.com/
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!