Getrawtransactionsinblock #4369

pull crispweed wants to merge 2 commits into bitcoin:master from crispweed:getrawtransactionsinblock changing 4 files +52 −0
  1. crispweed commented at 1:17 PM on June 19, 2014: none

    This adds a new 'getrawtransactionsinblock' rpc command. The use case for this is essentially for any application that connects over RPC to process transactions in each new block, as they come in (for example, for a wallet application). (I use this in the SwapBill client, but essentially just because the SwapBill client needs to maintain it's own wallet separately from the wallet in bitcoind or litecoind.) This is only possible through the current RPC interface if txindex is turned on. But in fact a full transaction index should not be necessary for this, because we already know the hash of the block containing the transactions. A second reason is then that it is also much more efficient to obtain all of the transactions in a block this way, rather than querying for the set of txids in a block and then making a whole bunch of calls to getrawtransaction. See https://bitcointalk.org/index.php?topic=630370.0 for some more discussion!

  2. getrawtransaction rpc method implementation added, and wired in to RPC command mechanism 17c780751e
  3. copied and adapted some basic automatic test lines for the getrawtransactionsinblock query 306d3fd094
  4. laanwj commented at 1:38 PM on June 19, 2014: member

    With getblock <hash> false you can already get the entire block data, including the transactions. Edit: in that case you have to chop up the block data yourself to get the separate transactions, but adding a new RPC to return data that is already available in a slightly different format seems overkill.

  5. BitcoinPullTester commented at 1:48 PM on June 19, 2014: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/306d3fd0948642f386b59faec6ac66766fa01fb5 for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.

  6. crispweed commented at 2:04 PM on June 19, 2014: none

    With getblock <hash> false you can already get the entire block data, including the transactions

    Ok, I wasn't aware of the second parameter to getblock, in fact. Yes this does what I need, then. (Chopping up the block data is no problem. I need txids also, but can get these with getblock <hash> true..)

  7. crispweed closed this on Jun 19, 2014

  8. Elbandi commented at 4:49 PM on June 19, 2014: contributor

    https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list doc is missing about this false parameter...

  9. laanwj commented at 5:29 PM on June 19, 2014: member

    Update the wiki then...

  10. bitcoin locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-20 06:55 UTC