Bitcoin Forum
April 30, 2017, 11:13:15 AM *
News: Latest stable version of Bitcoin Core: 0.14.1  [Torrent]. (New!)
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: bitcoind api listsinceblock  (Read 2910 times)
mav
Full Member
***
Offline Offline

Activity: 169


View Profile
April 05, 2012, 07:10:26 AM
 #1

I have a question about the call to listsinceblock when using bitcoind api

According to the spec the call takes an optional value for 'blockid' - spec at https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list

I have tested and confirmed that the call works as I thought it would by going to blockexplorer and copying the hash of the latest block as the 'blockid' value

eg this works

bitcoind listsinceblock 00000000000005a11a8149e365aa5d2e7a1cd1ab9ad3ae1aa37f8502845cd285

This shows me transactions from my wallet that have happened since block 174365 (which has the hash above)

What I am unsure of is how to get the hash value using bitcoind api calls.

The use I intended for this call was as a way to get the most recent transactions only. I planned to use the call to getblockcount which would give me the most recent block number, and then use that number to get the hash of the most recent block. I could use that hash in listsinceblock to give me a list of all the most recent transactions in my wallet.

In practice I will use listtransactions which will give me the required set of transactions for the specified account. However, I will post this here anyway because I am curious about how the call to listsinceblock is intended to work. Any help is appreciated.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1493550795
Hero Member
*
Offline Offline

Posts: 1493550795

View Profile Personal Message (Offline)

Ignore
1493550795
Reply with quote  #2

1493550795
Report to moderator
1493550795
Hero Member
*
Offline Offline

Posts: 1493550795

View Profile Personal Message (Offline)

Ignore
1493550795
Reply with quote  #2

1493550795
Report to moderator
1493550795
Hero Member
*
Offline Offline

Posts: 1493550795

View Profile Personal Message (Offline)

Ignore
1493550795
Reply with quote  #2

1493550795
Report to moderator
Pieter Wuille
Legendary
*
qt
Offline Offline

Activity: 1036


View Profile WWW
April 05, 2012, 12:20:12 PM
 #2

Use getblockhash <height> to get the hash of the <height>th number in the main chain.

aka sipa, core dev team

Tips and donations: 1KwDYMJMS4xq3ZEWYfdBRwYG2fHwhZsipa
mav
Full Member
***
Offline Offline

Activity: 169


View Profile
April 05, 2012, 08:46:09 PM
 #3

Use getblockhash <height> to get the hash of the <height>th number in the main chain.

Thanks a lot, this solution worked well. I will use bitcoind help in the future as it's more useful and up-to-date than the link I posted.
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!