From 61b32ca37466a69584f8ff89237e2eecaec44e98 Mon Sep 17 00:00:00 2001 From: thephez Date: Wed, 21 Aug 2019 11:30:27 -0400 Subject: [PATCH] RPC - Add param to listsinceblock Also fix depth issue with full tx template and add abandoned field --- .../devdoc/dash-core/rpcs/quick-reference.md | 2 +- .../dash-core/rpcs/rpcs/listsinceblock.md | 73 ++++++++++++------- _includes/helpers/vars.md | 11 ++- _includes/layout/base/rpc-table.html | 2 +- 4 files changed, 57 insertions(+), 31 deletions(-) diff --git a/_includes/devdoc/dash-core/rpcs/quick-reference.md b/_includes/devdoc/dash-core/rpcs/quick-reference.md index 7ccbfa6d..45bd431e 100644 --- a/_includes/devdoc/dash-core/rpcs/quick-reference.md +++ b/_includes/devdoc/dash-core/rpcs/quick-reference.md @@ -311,7 +311,7 @@ default. * [ListLockUnspent][rpc listlockunspent]: {{summary_listLockUnspent}} * [ListReceivedByAccount][rpc listreceivedbyaccount]: {{summary_listReceivedByAccount}} {{DASH_UPDATED0_13_0}} {{DEPRECATED}} * [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}} * [ListUnspent][rpc listunspent]: {{summary_listUnspent}} {{DASH_UPDATED0_14_1}} * [LockUnspent][rpc lockunspent]: {{summary_lockUnspent}} diff --git a/_includes/devdoc/dash-core/rpcs/rpcs/listsinceblock.md b/_includes/devdoc/dash-core/rpcs/rpcs/listsinceblock.md index 84049e19..242cd841 100644 --- a/_includes/devdoc/dash-core/rpcs/rpcs/listsinceblock.md +++ b/_includes/devdoc/dash-core/rpcs/rpcs/listsinceblock.md @@ -41,6 +41,16 @@ The `listsinceblock` RPC {{summary_listSinceBlock}} {{INCLUDE_INCLUDE_WATCH_ONLY_PARAMETER}} +*Parameter #4---include_removed* + +{% itemplate ntpd1 %} +- n: "include_removed" + t: "bool" + p: "Optional
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** {% assign DEPTH="→ → → " %} @@ -64,6 +74,11 @@ The `listsinceblock` RPC {{summary_listSinceBlock}} {{INCLUDE_F_LIST_TRANSACTIONS}} {{INCLUDE_F_LIST_TRANSACTIONS_F_FULL}} +- n: "→
`removed`" + t: "array" + p: "Optional
(0 or 1)" + d: "Structure is the same as `transactions`. Only present if `include_removed` is `true`.
_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: "→
`lastblock`" t: "string (hex)" p: "Required
(exactly 1)" @@ -71,15 +86,15 @@ The `listsinceblock` RPC {{summary_listSinceBlock}} {% 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 transactions) and the header hash of the sixth most recent block. {% highlight bash %} dash-cli -testnet listsinceblock \ - 00000000688633a503f69818a70eac281302e9189b1bb57a76a05c329fcda718 \ - 6 true + 0000000001fc119ea77e0c67783227fb9d55386125179ea5597109d311af2337 \ + 6 true true {% endhighlight %} Result (edited to show only two payments): @@ -89,44 +104,50 @@ Result (edited to show only two payments): "transactions": [ { "account": "", - "address": "yLXe1NwXmhZbtM6drTXbWFvtEqpsJZkKd2", + "address": "yMaodAgCofB2gmHEtATAiV3w5NkzTpmkgS", "category": "send", - "amount": -1.00000000, - "label": "Receiving", + "amount": -2365.65209808, + "label": "Mining Consolidation", "vout": 0, - "fee": -0.00000226, - "confirmations": 0, + "fee": -0.00031420, + "confirmations": 5, "instantlock": true, - "instantlock_internal": true, - "chainlock": false, - "trusted": true, - "txid": "cc2e6c49faae395d79cfc91d188881e479f544c220e4dfee016889cd53b32645", + "instantlock_internal": false, + "chainlock": true, + "blockhash": "00000000001c4e142c6deaa273206706d37a7aa792887d9bd81ae787d4259137", + "blockindex": 1, + "blocktime": 1566399553, + "txid": "bb8a2789c3166181cc190e0fd7675770217b69c9aeafe0d8207baf1ebeb05845", "walletconflicts": [ ], - "time": 1554734925, - "timereceived": 1554734925, + "time": 1566399271, + "timereceived": 1566399271, "abandoned": false }, { - "account": "", - "address": "yLXe1NwXmhZbtM6drTXbWFvtEqpsJZkKd2", + "account": "Mining Consolidation", + "address": "yMaodAgCofB2gmHEtATAiV3w5NkzTpmkgS", "category": "receive", - "amount": 1.00000000, - "label": "Receiving", + "amount": 2365.65209808, + "label": "Mining Consolidation", "vout": 0, - "confirmations": 0, + "confirmations": 5, "instantlock": true, - "instantlock_internal": true, - "chainlock": false, - "trusted": true, - "txid": "cc2e6c49faae395d79cfc91d188881e479f544c220e4dfee016889cd53b32645", + "instantlock_internal": false, + "chainlock": true, + "blockhash": "00000000001c4e142c6deaa273206706d37a7aa792887d9bd81ae787d4259137", + "blockindex": 1, + "blocktime": 1566399553, + "txid": "bb8a2789c3166181cc190e0fd7675770217b69c9aeafe0d8207baf1ebeb05845", "walletconflicts": [ ], - "time": 1554734925, - "timereceived": 1554734925 + "time": 1566399271, + "timereceived": 1566399271 } ], - "lastblock": "0000000006be841cd8534b02733d833ad9dd7634ab0897a7e5cd92c574a529a3" + "removed": [ + ], + "lastblock": "000000000158ad1e4eab53044e18aaf76e605a27252862d4f1d78cfd373f1686" } {% endhighlight %} diff --git a/_includes/helpers/vars.md b/_includes/helpers/vars.md index 7461f16e..572fa50d 100644 --- a/_includes/helpers/vars.md +++ b/_includes/helpers/vars.md @@ -48,17 +48,17 @@ http://opensource.org/licenses/MIT. p: "Required
(exactly 1)" d: "The number of confirmations the transaction has received. Will be `0` for unconfirmed and `-1` for conflicted" -- n: "→
`instantlock`" +- n: "{{DEPTH}}
`instantlock`" t: "bool" p: "Required
(exactly 1)" d: "Current transaction lock state (InstantSend and/or ChainLock)" -- n: "→
`instantlock_internal`" +- n: "{{DEPTH}}
`instantlock_internal`" t: "bool" p: "Required
(exactly 1)" d: "Current InstantSend transaction lock state" -- n: "
`chainlock`" +- n: "{{DEPTH}}
`chainlock`" t: "bool" p: "Required
(exactly 1)" d: "*Added in Dash Core 0.14.0*

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
(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" +- n: "{{DEPTH}}
`abandoned`" + t: "bool" + p: "Optional
(0 or 1)" + d: "`true` if the transaction has been abandoned (inputs are respendable). Only available for the 'send' category of transactions." + - n: "{{DEPTH}}
`comment`" t: "string" p: "Optional
(0 or 1)" diff --git a/_includes/layout/base/rpc-table.html b/_includes/layout/base/rpc-table.html index 17402667..f068c930 100644 --- a/_includes/layout/base/rpc-table.html +++ b/_includes/layout/base/rpc-table.html @@ -779,7 +779,7 @@ th.tg-sort-header::-moz-selection { background:transparent; }th.tg-sort-header:: Wallet ListSinceBlock Y - Updated in 0.14.0 + Updated in 0.14.1 Wallet