Add details for GetSpentInfo

This commit is contained in:
thephez 2017-10-09 15:45:24 -04:00
parent 2b385adcf5
commit 6b4c2febce
3 changed files with 66 additions and 3 deletions

View file

@ -91,7 +91,7 @@ These RPCs are all Dash-specific and not found in Bitcoin Core
* [GetDifficulty][rpc getdifficulty]: {{summary_getDifficultly}}
* [GetMemPoolInfo][rpc getmempoolinfo]: {{summary_getMemPoolInfo}} {{UPDATED0_12_0}}
* [GetRawMemPool][rpc getrawmempool]: {{summary_getRawMemPool}} {{UPDATED0_13_0}}
* [GetSpentInfo][rpc getspentinfo]: {{summary_getSpentInfo}}
* [GetSpentInfo][rpc getspentinfo]: {{summary_getSpentInfo}} {{DASH_NEW0_12_1}}
* [GetTxOut][rpc gettxout]: {{summary_getTxOut}}
* [GetTxOutProof][rpc gettxoutproof]: {{summary_getTxOutProof}} {{NEW0_11_0}}
* [GetTxOutSetInfo][rpc gettxoutsetinfo]: {{summary_getTxOutSetInfo}}

View file

@ -7,8 +7,71 @@ http://opensource.org/licenses/MIT.
##### GetSpentInfo
{% include helpers/subhead-links.md %}
{% assign summary_getSpentInfo="returns the txid and index where an output is spent (requires `spentindex` to be enabled)." %}
{% autocrossref %}
{% assign summary_getSpentInfo= %}
*Added in Dash Core 0.12.1*
The `getspentinfo` RPC {{summary_getSpentInfo}}
*Parameter #1---the TXID of the output*
{% itemplate ntpd1 %}
- n: "TXID"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The TXID of the transaction containing the relevant output, encoded as hex in RPC byte order"
{% enditemplate %}
*Parameter #2---the start block height*
{% itemplate ntpd1 %}
- n: "Index"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The block height to begin looking in"
{% enditemplate %}
*Result---the TXID and spending input index*
{% itemplate ntpd1 %}
- n: "`result`"
t: "object/null"
p: "Required<br>(exactly 1)"
d: "Information about the spent output. If output wasn't found or if an error occurred, this will be JSON `null`"
- n: "→<br>`txid`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The output txid"
- n: "→<br>`index`"
t: "number"
p: "Required<br>(exactly 1)"
d: "The spending input index"
{% enditemplate %}
*Example from Dash Core 0.12.2*
Get the txid and index where an output is spent:
{% highlight bash %}
dash-cli getspentinfo \
'''
{
"txid": "e0a06b47f0de6f3851a228d5ac377ac38b495adf04298c43e951e679c5b0aa8f", \
"index": 0
}
{% endhighlight %}
Result:
**Example needed**
{% highlight json %}
{% endhighlight %}
{% endautocrossref %}