RPC - Add param to listsinceblock

Also fix depth issue with full tx template and add abandoned field
This commit is contained in:
thephez 2019-08-21 11:30:27 -04:00
parent 4922cbf22f
commit 61b32ca374
4 changed files with 57 additions and 31 deletions

View file

@ -311,7 +311,7 @@ default.
* [ListLockUnspent][rpc listlockunspent]: {{summary_listLockUnspent}} * [ListLockUnspent][rpc listlockunspent]: {{summary_listLockUnspent}}
* [ListReceivedByAccount][rpc listreceivedbyaccount]: {{summary_listReceivedByAccount}} {{DASH_UPDATED0_13_0}} {{DEPRECATED}} * [ListReceivedByAccount][rpc listreceivedbyaccount]: {{summary_listReceivedByAccount}} {{DASH_UPDATED0_13_0}} {{DEPRECATED}}
* [ListReceivedByAddress][rpc listreceivedbyaddress]: {{summary_listReceivedByAddress}} {{DASH_UPDATED0_13_0}} * [ListReceivedByAddress][rpc listreceivedbyaddress]: {{summary_listReceivedByAddress}} {{DASH_UPDATED0_13_0}}
* [ListSinceBlock][rpc listsinceblock]: {{summary_listSinceBlock}} {{DASH_UPDATED0_14_0}} * [ListSinceBlock][rpc listsinceblock]: {{summary_listSinceBlock}} {{DASH_UPDATED0_14_1}}
* [ListTransactions][rpc listtransactions]: {{summary_listTransactions}} {{DASH_UPDATED0_14_0}} * [ListTransactions][rpc listtransactions]: {{summary_listTransactions}} {{DASH_UPDATED0_14_0}}
* [ListUnspent][rpc listunspent]: {{summary_listUnspent}} {{DASH_UPDATED0_14_1}} * [ListUnspent][rpc listunspent]: {{summary_listUnspent}} {{DASH_UPDATED0_14_1}}
* [LockUnspent][rpc lockunspent]: {{summary_lockUnspent}} * [LockUnspent][rpc lockunspent]: {{summary_lockUnspent}}

View file

@ -41,6 +41,16 @@ The `listsinceblock` RPC {{summary_listSinceBlock}}
{{INCLUDE_INCLUDE_WATCH_ONLY_PARAMETER}} {{INCLUDE_INCLUDE_WATCH_ONLY_PARAMETER}}
*Parameter #4---include_removed*
{% itemplate ntpd1 %}
- n: "include_removed"
t: "bool"
p: "Optional<br>Default=`true`"
d: "Show transactions that were removed due to a reorg in the \"removed\" array (not guaranteed to work on pruned nodes)"
{% enditemplate %}
**Result** **Result**
{% assign DEPTH="→ → → " %} {% assign DEPTH="→ → → " %}
@ -64,6 +74,11 @@ The `listsinceblock` RPC {{summary_listSinceBlock}}
{{INCLUDE_F_LIST_TRANSACTIONS}} {{INCLUDE_F_LIST_TRANSACTIONS}}
{{INCLUDE_F_LIST_TRANSACTIONS_F_FULL}} {{INCLUDE_F_LIST_TRANSACTIONS_F_FULL}}
- n: "→<br>`removed`"
t: "array"
p: "Optional<br>(0 or 1)"
d: "Structure is the same as `transactions`. Only present if `include_removed` is `true`.<br>_Note_: transactions that were re-added in the active chain will appear as-is in this array, and may thus have a positive confirmation count."
- n: "→<br>`lastblock`" - n: "→<br>`lastblock`"
t: "string (hex)" t: "string (hex)"
p: "Required<br>(exactly 1)" p: "Required<br>(exactly 1)"
@ -71,15 +86,15 @@ The `listsinceblock` RPC {{summary_listSinceBlock}}
{% enditemplate %} {% enditemplate %}
*Example from Dash Core 0.14.0* *Example from Dash Core 0.14.1*
Get all transactions since a particular block (including watch-only Get all transactions since a particular block (including watch-only
transactions) and the header hash of the sixth most recent block. transactions) and the header hash of the sixth most recent block.
{% highlight bash %} {% highlight bash %}
dash-cli -testnet listsinceblock \ dash-cli -testnet listsinceblock \
00000000688633a503f69818a70eac281302e9189b1bb57a76a05c329fcda718 \ 0000000001fc119ea77e0c67783227fb9d55386125179ea5597109d311af2337 \
6 true 6 true true
{% endhighlight %} {% endhighlight %}
Result (edited to show only two payments): Result (edited to show only two payments):
@ -89,44 +104,50 @@ Result (edited to show only two payments):
"transactions": [ "transactions": [
{ {
"account": "", "account": "",
"address": "yLXe1NwXmhZbtM6drTXbWFvtEqpsJZkKd2", "address": "yMaodAgCofB2gmHEtATAiV3w5NkzTpmkgS",
"category": "send", "category": "send",
"amount": -1.00000000, "amount": -2365.65209808,
"label": "Receiving", "label": "Mining Consolidation",
"vout": 0, "vout": 0,
"fee": -0.00000226, "fee": -0.00031420,
"confirmations": 0, "confirmations": 5,
"instantlock": true, "instantlock": true,
"instantlock_internal": true, "instantlock_internal": false,
"chainlock": false, "chainlock": true,
"trusted": true, "blockhash": "00000000001c4e142c6deaa273206706d37a7aa792887d9bd81ae787d4259137",
"txid": "cc2e6c49faae395d79cfc91d188881e479f544c220e4dfee016889cd53b32645", "blockindex": 1,
"blocktime": 1566399553,
"txid": "bb8a2789c3166181cc190e0fd7675770217b69c9aeafe0d8207baf1ebeb05845",
"walletconflicts": [ "walletconflicts": [
], ],
"time": 1554734925, "time": 1566399271,
"timereceived": 1554734925, "timereceived": 1566399271,
"abandoned": false "abandoned": false
}, },
{ {
"account": "", "account": "Mining Consolidation",
"address": "yLXe1NwXmhZbtM6drTXbWFvtEqpsJZkKd2", "address": "yMaodAgCofB2gmHEtATAiV3w5NkzTpmkgS",
"category": "receive", "category": "receive",
"amount": 1.00000000, "amount": 2365.65209808,
"label": "Receiving", "label": "Mining Consolidation",
"vout": 0, "vout": 0,
"confirmations": 0, "confirmations": 5,
"instantlock": true, "instantlock": true,
"instantlock_internal": true, "instantlock_internal": false,
"chainlock": false, "chainlock": true,
"trusted": true, "blockhash": "00000000001c4e142c6deaa273206706d37a7aa792887d9bd81ae787d4259137",
"txid": "cc2e6c49faae395d79cfc91d188881e479f544c220e4dfee016889cd53b32645", "blockindex": 1,
"blocktime": 1566399553,
"txid": "bb8a2789c3166181cc190e0fd7675770217b69c9aeafe0d8207baf1ebeb05845",
"walletconflicts": [ "walletconflicts": [
], ],
"time": 1554734925, "time": 1566399271,
"timereceived": 1554734925 "timereceived": 1566399271
} }
], ],
"lastblock": "0000000006be841cd8534b02733d833ad9dd7634ab0897a7e5cd92c574a529a3" "removed": [
],
"lastblock": "000000000158ad1e4eab53044e18aaf76e605a27252862d4f1d78cfd373f1686"
} }
{% endhighlight %} {% endhighlight %}

View file

@ -48,17 +48,17 @@ http://opensource.org/licenses/MIT.
p: "Required<br>(exactly 1)" p: "Required<br>(exactly 1)"
d: "The number of confirmations the transaction has received. Will be `0` for unconfirmed and `-1` for conflicted" d: "The number of confirmations the transaction has received. Will be `0` for unconfirmed and `-1` for conflicted"
- n: "<br>`instantlock`" - n: "{{DEPTH}}<br>`instantlock`"
t: "bool" t: "bool"
p: "Required<br>(exactly 1)" p: "Required<br>(exactly 1)"
d: "Current transaction lock state (InstantSend and/or ChainLock)" d: "Current transaction lock state (InstantSend and/or ChainLock)"
- n: "<br>`instantlock_internal`" - n: "{{DEPTH}}<br>`instantlock_internal`"
t: "bool" t: "bool"
p: "Required<br>(exactly 1)" p: "Required<br>(exactly 1)"
d: "Current InstantSend transaction lock state" d: "Current InstantSend transaction lock state"
- n: "<br>`chainlock`" - n: "{{DEPTH}}<br>`chainlock`"
t: "bool" t: "bool"
p: "Required<br>(exactly 1)" p: "Required<br>(exactly 1)"
d: "*Added in Dash Core 0.14.0*<br><br>If set to `true`, this transaction is in a block that is locked (not susceptible to a chain re-org)" d: "*Added in Dash Core 0.14.0*<br><br>If set to `true`, this transaction is in a block that is locked (not susceptible to a chain re-org)"
@ -108,6 +108,11 @@ http://opensource.org/licenses/MIT.
p: "Required<br>(exactly 1)" p: "Required<br>(exactly 1)"
d: "A Unix epoch time when the transaction was detected by the local node, or the time of the block on the local best block chain that included the transaction" d: "A Unix epoch time when the transaction was detected by the local node, or the time of the block on the local best block chain that included the transaction"
- n: "{{DEPTH}}<br>`abandoned`"
t: "bool"
p: "Optional<br>(0 or 1)"
d: "`true` if the transaction has been abandoned (inputs are respendable). Only available for the 'send' category of transactions."
- n: "{{DEPTH}}<br>`comment`" - n: "{{DEPTH}}<br>`comment`"
t: "string" t: "string"
p: "Optional<br>(0 or 1)" p: "Optional<br>(0 or 1)"

View file

@ -779,7 +779,7 @@ th.tg-sort-header::-moz-selection { background:transparent; }th.tg-sort-header::
<td class="tg-yw4l">Wallet</td> <td class="tg-yw4l">Wallet</td>
<td class="tg-yw4l"><a href="#listsinceblock">ListSinceBlock</a></td> <td class="tg-yw4l"><a href="#listsinceblock">ListSinceBlock</a></td>
<td class="tg-baqh">Y</td> <td class="tg-baqh">Y</td>
<td class="tg-baqh">Updated in 0.14.0</td> <td class="tg-baqh">Updated in 0.14.1</td>
</tr> </tr>
<tr> <tr>
<td class="tg-b7b8">Wallet</td> <td class="tg-b7b8">Wallet</td>