Skip to content

New RPC command - getrawtransaction - #324

Closed
forrestv wants to merge 1 commit into
bitcoin:masterfrom
forrestv:getrawtransaction
Closed

forrestv wants to merge 1 commit into
bitcoin:masterfrom
forrestv:getrawtransaction

Conversation

@forrestv

Copy link
Copy Markdown
Contributor

Given a transaction hash, getrawtransaction returns that transaction and some metadata.

Example: (this is on the testnet)

$ ./bitcoind getrawtransaction ba73f8c8701550e50f667c6c02d671afd3f95069ce02938453048e79b0812bba
{
"tx" : {
"version" : 1,
"txins" : [
{
"previous_output" : {
"hash" : "daea922234887459ba985977112454895466a36c167921651111596cc439add4",
"index" : 0
},
"script" : "47304402206fdeaabac261ef0e0183892555a7cdc94d23e4a01c1c55509d352215ee1628c302204dae58fa97ecf77cede4d340573f62abe13f1b7d9bc487a8e9230d4e9557fdd50141043338498afdbe933339072d3fe6ed36196b2e868f888df55e1b32ad27e418f3621628941482a816acde7b53d651fc13b3208885c07e6f1c54b4c04a5c5d009d86",
"sequence" : 4294967295
}
],
"txouts" : [
{
"value" : 29462000000,
"script2" : "76a9142a5ce61dff67eb864979905d2ca05d000a0586fd88ac"
},
{
"value" : 500000000,
"script2" : "76a9142400224224860152f4211a2b9daa6c45c79d04f388ac"
}
],
"lock_time" : 0
},
"parent_blocks" : [
"00000000004610ac94e40725653c5ff54588a41e24d284244fcd4efd36f12ee9"
],
"txout_claims" : [
[
"9f8aa7191c75c96d1cdf8a9fe78a5b4fa1d772cbe7345c1cabdb3f7c91c71cf7"
],
[
]
]
}

@gavinandresen

Copy link
Copy Markdown
Contributor

What is this for? I'm about to start working on the 'headers only' branch that will break this (because not every node will store every transaction).

@forrestv

Copy link
Copy Markdown
Contributor Author

This is for providing a way for RPC clients to check the status of transactions. It's mostly useful for mining pool servers - to check whether a tx has been put into a block, and so whether to include it and txs depending on it in the block being mined.

@forrestv

Copy link
Copy Markdown
Contributor Author

@TheBlueMatt

Copy link
Copy Markdown
Contributor

Im not a big fan of this, RPC is getting really huge and we keep adding more and more features to it. I wouldnt mind it being so big if all the UIs were using something more standard, ie a libbitcoin-style thing, and I prefer to get something like that up before we keep merging more and more rpc calls.

… getrawtransaction returns that transaction and some metadata.
@gavinandresen

Copy link
Copy Markdown
Contributor

Closing this; please propose/discuss new RPC commands on the bitcoin mailing list or the forums.

dexX7 added a commit to dexX7/bitcoin that referenced this pull request Jan 4, 2016
2a90e9f Fix missing seed blocks between 380000 and 390000 (zathras-crypto)
99fb8c5 Fix and update seed blocks (zathras-crypto)
destenson pushed a commit to destenson/bitcoin--bitcoin that referenced this pull request Nov 18, 2017
…umbers.

d7a4edc [UI] zPIV-Control: disable negative confirmation numbers. (Mrs-X)

Tree-SHA512: 392fcb1f1aa2aedf35b80dae45b0a83222c32e6ab6d6a7ec5246375b1ef250898fb04c1b0aa1e84c2730478e6e86c32159bdec3daf273284d614caa7daa7662b
destenson pushed a commit to destenson/bitcoin--bitcoin that referenced this pull request Nov 18, 2017
lateminer pushed a commit to lateminer/bitcoin that referenced this pull request Oct 16, 2019
cryptapus pushed a commit to cryptapus/bitcoin that referenced this pull request May 3, 2021
…onfigurable

61d66c5 Update name_multiupdate.py regtest. (Daniel Kraft)
9327a74 Option to limit the length of pending name ops. (Daniel Kraft)
48dfca8 Retrieve length of pending name chains. (Daniel Kraft)

Pull request description:

  This set of changes introduces a new config option `-limitnamechains`, which controls how long chains of pending name operations can be generated by the `name_update` RPC.  This has two main advantages:

  1. It replaces the current mechanism where `name_update` is hardcoded to (currently) disallow pending updates (to be lifted with bitcoin#324 in the future).  It allows every user to decide for themselves if they want.

  2. Even in the future (after resolving bitcoin#324), the limit is useful.  It allows us to fail the RPC with an error for excessively long chains, before running into the general mempool limit (which then leads to unpleasant UX as per xaya/xaya#99).

  This also allows us to (mostly) resolve the code changes necessary for bitcoin#324 in the future, by simplifying the `name_multiupdate.py` test already.

Top commit has no ACKs.

Tree-SHA512: c5ff5b4d92cf355746416d3228e9da9a2295793d77418e7a43119cc62019f09cce789f152839d9fa08e4e5bfa49815f6d2751babc79576ae510ef96fd4df3b22
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants