Bitcoin Forum
June 14, 2024, 06:44:24 PM *
News: Voting for pizza day contest
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: latest transactions  (Read 605 times)
MrKain (OP)
Newbie
*
Offline Offline

Activity: 24
Merit: 0



View Profile
June 14, 2013, 06:48:05 PM
 #1


I'm trying to write a program to display the latest transactions on the bitcoin
network as they happen..

I call getinfo to get the block count , and then I call getblockhash with this
number, and then call getblock with the hash..

However, I can only get information on completed blocks.

How do services like https://blockchain.info/ get the latest transactions
for incomplete blocks ?
grue
Legendary
*
Offline Offline

Activity: 2058
Merit: 1431



View Profile
June 14, 2013, 07:02:47 PM
 #2

getrawmempool
https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list

It is pitch black. You are likely to be eaten by a grue.

Adblock for annoying signature ads | Enhanced Merit UI
MrKain (OP)
Newbie
*
Offline Offline

Activity: 24
Merit: 0



View Profile
June 14, 2013, 07:33:18 PM
 #3



yes, getrawmempool lists the transactions in bitcoind's memory, - but that
still doesnt help - the transactions are in alphabetical order not as they are
received --

how can i get bitcoind to give them to me, in the order it got them ?

grue
Legendary
*
Offline Offline

Activity: 2058
Merit: 1431



View Profile
June 15, 2013, 01:43:35 AM
 #4



yes, getrawmempool lists the transactions in bitcoind's memory, - but that
still doesnt help - the transactions are in alphabetical order not as they are
received --

how can i get bitcoind to give them to me, in the order it got them ?
That is not supported by bitcoind. You can do one of the following:

  • poll the daemon frequently and use a delta filter with a database to find "new" transactions
  • modify bitcoind to run a command when it receives a transaction. good ideas are: a) hook CTxMemPool::accept() or b) modify walletnotify rpc command to alert for all transactions, not just your own
  • steal procure data from blockchain.info

tl;dr there's no ez solution, you'll have to get your hands dirty.

It is pitch black. You are likely to be eaten by a grue.

Adblock for annoying signature ads | Enhanced Merit UI
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!