Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpc: add missing fields to wallet rpc help output #16689

Merged
merged 2 commits into from
Oct 10, 2019

Conversation

ariard
Copy link
Contributor

@ariard ariard commented Aug 22, 2019

Knowledge of walletconflicts field existence is really nice when you're debugging conflicts. Was added in #3671 but never documented in RPC helps.

Others were added after a quick skim, we may still have missing ones in wallet rpcs.

@fanquake fanquake changed the title Add missing fields in some rpc wallets helps rpc: add missing fields to wallet rpc help output Aug 23, 2019
Copy link
Member

@fanquake fanquake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK - I'll have a look if there are more missing fields.

walletconflicts was added in #3671.

nit: In the commit body I assume you mean gettransaction.

@cvengler
Copy link
Contributor

Concept ACK

luke-jr pushed a commit to luke-jr/bitcoin that referenced this pull request Aug 23, 2019
Fields involvesWatchonly, generated, walletconflicts were missing
in result description of listtransactions, listsinceblock,
gettransactions

Github-Pull: bitcoin#16689
Rebased-From: b8ea120
@ariard ariard force-pushed the 2019-08-missing-fields-rpcs-help branch from b8ea120 to fbc3c9f Compare August 23, 2019 22:46
@ariard
Copy link
Contributor Author

ariard commented Aug 23, 2019

Updated at fbc3c9f as suggested in #16689 (comment) (but only output from WalletTxToJSON as we may have small diffs between RPCs for other fields)

Copy link
Member

@jonatack jonatack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK.

@DrahtBot
Copy link
Contributor

DrahtBot commented Aug 24, 2019

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

No conflicts as of last run.

@ariard ariard force-pushed the 2019-08-missing-fields-rpcs-help branch from fbc3c9f to c86def6 Compare August 26, 2019 14:46
@ariard
Copy link
Contributor Author

ariard commented Aug 26, 2019

Updated at c86def6 with @jonatack comments addressed, thanks for the review!

" transaction conflicts with the block chain.\n"
" \"generated\": xxx, (bool) Only returns true if transaction only input is a coinbase one, otherwise false.\n"
" \"trusted\": xxx, (bool) Whether we consider the outputs of this unconfirmed transaction safe to spend.\n"
" \"blockhash\": \"hashvalue\", (string) The block hash containing the transaction.\n"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, try to have it aligned with surrounding lines.

Copy link
Contributor Author

@ariard ariard Sep 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean blockhash compare to trusted and others ? Don't get the misalignment here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the first commit (moveonly) should actually be moveonly (via git diff --color-moved=dimmed-zebra).

Otherwise the rendered whitespace will be messed up. (You can get the help text with the help listtransactions rpc)

" \"blockindex\": n, (numeric) The index of the transaction in the block that includes it.\n"
" \"blocktime\": xxx, (numeric) The block time in seconds since epoch (1 Jan 1970 GMT).\n"
" \"txid\": \"transactionid\", (string) The transaction id.\n"
" \"walletconflicts: \"hashvalue\", (array) List of txids that conflict with this transaction.\n"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It returns array here. So \"walletconflicts\": [ \"TXID\", ... ] should be used instead. See #16869 as an example.

@ariard ariard force-pushed the 2019-08-missing-fields-rpcs-help branch from 626dc9c to a0b9216 Compare September 20, 2019 17:28
@maflcko
Copy link
Member

maflcko commented Sep 22, 2019

Rendered diff:
diff --git a/gettransaction b/gettransaction
index cf09efd..7ef6106 100644
--- a/gettransaction
+++ b/gettransaction
@@ -10,37 +10,46 @@ Arguments:
 Result:
 {
   "amount" : x.xxx,        (numeric) The transaction amount in BTC
   "fee": x.xxx,            (numeric) The amount of the fee in BTC. This is negative and only available for the 
                               'send' category of transactions.
-  "confirmations" : n,     (numeric) The number of confirmations
-  "blockhash" : "hash",  (string) The block hash
-  "blockindex" : xx,       (numeric) The index of the transaction in the block that includes it
-  "blocktime" : ttt,       (numeric) The time in seconds since epoch (1 Jan 1970 GMT)
+    "confirmations": n,                        (numeric) The number of confirmations for the transaction. Negative confirmations indicate the
+                                                       transaction conflicts with the block chain.
+    "generated": xxx,                          (bool) Only returns true if transaction only input is a coinbase one, otherwise false.
+    "trusted": xxx,                            (bool) Whether we consider the outputs of this unconfirmed transaction safe to spend.
+    "blockhash": "hashvalue",                  (string) The block hash containing the transaction.
+    "blockindex": n,                           (numeric) The index of the transaction in the block that includes it.
+    "blocktime": xxx,                          (numeric) The block time in seconds since epoch (1 Jan 1970 GMT).
     "txid": "transactionid",                   (string) The transaction id.
-  "time" : ttt,            (numeric) The transaction time in seconds since epoch (1 Jan 1970 GMT)
-  "timereceived" : ttt,    (numeric) The time received in seconds since epoch (1 Jan 1970 GMT)
+    "walletconflicts": [                       (array) List of txids.
+      "txid",                                  (string) The conflicting txid.
+      ...
+    ],
+    "time": xxx,                               (numeric) The transaction time in seconds since epoch (midnight Jan 1 1970 GMT).
+    "timereceived": xxx,                       (numeric) The time received in seconds since epoch (midnight Jan 1 1970 GMT).
+    "comment": "...",                          (string) If a comment is associated with the transaction, only present if not empty.
     "bip125-replaceable": "yes|no|unknown",    (string) Whether this transaction could be replaced due to BIP125 (replace-by-fee);
                                                      may be unknown for unconfirmed transactions not in the mempool
   "details" : [
     {
+      "involvesWatchonly": xxx,         (bool) Only returns true if imported addresses were involved in transaction.
       "address" : "address",          (string) The bitcoin address involved in the transaction
       "category" :                      (string) The transaction category.
                    "send"                  Transactions sent.
                    "receive"               Non-coinbase transactions received.
                    "generate"              Coinbase transactions received with more than 100 confirmations.
                    "immature"              Coinbase transactions received with 100 or fewer confirmations.
                    "orphan"                Orphaned coinbase transactions received.
       "amount" : x.xxx,                 (numeric) The amount in BTC
       "label" : "label",              (string) A comment for the address/transaction, if any
       "vout" : n,                       (numeric) the vout value
       "fee": x.xxx,                     (numeric) The amount of the fee in BTC. This is negative and only available for the 
                                            'send' category of transactions.
       "abandoned": xxx                  (bool) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the 
                                            'send' category of transactions.
     }
     ,...
   ],
   "hex" : "data"         (string) Raw data for transaction
   "decoded" : transaction         (json object) Optional, the decoded transaction (only present when `verbose` is passed), equivalent to the
                                                 RPC decoderawtransaction method, or the RPC getrawtransaction method when `verbose` is passed.
 }
diff --git a/listreceivedbyaddress b/listreceivedbyaddress
index 3e895f4..566ddb3 100644
--- a/listreceivedbyaddress
+++ b/listreceivedbyaddress
@@ -11,15 +11,15 @@ Arguments:
 Result:
 [
   {
-    "involvesWatchonly" : true,        (bool) Only returned if imported addresses were involved in transaction
+    "involvesWatchonly" : true,        (bool) Only returns true if imported addresses were involved in transaction.
     "address" : "receivingaddress",  (string) The receiving address
     "amount" : x.xxx,                  (numeric) The total amount in BTC received by the address
     "confirmations" : n,               (numeric) The number of confirmations of the most recent transaction included
     "label" : "label",               (string) The label of the receiving address. The default label is "".
     "txids": [
        "txid",                         (string) The ids of transactions received with the address 
        ...
     ]
   }
   ,...
 ]
diff --git a/listreceivedbylabel b/listreceivedbylabel
index 38d25bf..d716f9b 100644
--- a/listreceivedbylabel
+++ b/listreceivedbylabel
@@ -10,10 +10,10 @@ Arguments:
 Result:
 [
   {
-    "involvesWatchonly" : true,   (bool) Only returned if imported addresses were involved in transaction
+    "involvesWatchonly" : true,   (bool) Only returns true if imported addresses were involved in transaction.
     "amount" : x.xxx,             (numeric) The total amount received by addresses with this label
     "confirmations" : n,          (numeric) The number of confirmations of the most recent transaction included
     "label" : "label"           (string) The label of the receiving address. The default label is "".
   }
   ,...
 ]
diff --git a/listsinceblock b/listsinceblock
index be347aa..9a9b8f7 100644
--- a/listsinceblock
+++ b/listsinceblock
@@ -14,35 +14,43 @@ Arguments:
 Result:
 {
   "transactions": [
+    "involvesWatchonly": xxx, (bool) Only returns true if imported addresses were involved in transaction.
     "address":"address",    (string) The bitcoin address of the transaction.
     "category":               (string) The transaction category.
                 "send"                  Transactions sent.
                 "receive"               Non-coinbase transactions received.
                 "generate"              Coinbase transactions received with more than 100 confirmations.
                 "immature"              Coinbase transactions received with 100 or fewer confirmations.
                 "orphan"                Orphaned coinbase transactions received.
     "amount": x.xxx,          (numeric) The amount in BTC. This is negative for the 'send' category, and is positive
                                          for all other categories
     "vout" : n,               (numeric) the vout value
     "fee": x.xxx,             (numeric) The amount of the fee in BTC. This is negative and only available for the 'send' category of transactions.
-    "confirmations": n,       (numeric) The number of confirmations for the transaction.
-                                          When it's < 0, it means the transaction conflicted that many blocks ago.
+    "confirmations": n,                        (numeric) The number of confirmations for the transaction. Negative confirmations indicate the
+                                                       transaction conflicts with the block chain.
+    "generated": xxx,                          (bool) Only returns true if transaction only input is a coinbase one, otherwise false.
+    "trusted": xxx,                            (bool) Whether we consider the outputs of this unconfirmed transaction safe to spend.
     "blockhash": "hashvalue",                  (string) The block hash containing the transaction.
     "blockindex": n,                           (numeric) The index of the transaction in the block that includes it.
     "blocktime": xxx,                          (numeric) The block time in seconds since epoch (1 Jan 1970 GMT).
     "txid": "transactionid",                   (string) The transaction id.
-    "time": xxx,              (numeric) The transaction time in seconds since epoch (Jan 1 1970 GMT).
-    "timereceived": xxx,      (numeric) The time received in seconds since epoch (Jan 1 1970 GMT).
+    "walletconflicts": [                       (array) List of txids.
+      "txid",                                  (string) The conflicting txid.
+      ...
+    ],
+    "time": xxx,                               (numeric) The transaction time in seconds since epoch (midnight Jan 1 1970 GMT).
+    "timereceived": xxx,                       (numeric) The time received in seconds since epoch (midnight Jan 1 1970 GMT).
+    "comment": "...",                          (string) If a comment is associated with the transaction, only present if not empty.
     "bip125-replaceable": "yes|no|unknown",    (string) Whether this transaction could be replaced due to BIP125 (replace-by-fee);
                                                      may be unknown for unconfirmed transactions not in the mempool
     "abandoned": xxx,         (bool) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the 'send' category of transactions.
     "comment": "...",       (string) If a comment is associated with the transaction.
     "label" : "label"       (string) A comment for the address/transaction, if any
     "to": "...",            (string) If a comment to is associated with the transaction.
   ],
   "removed": [
     <structure is the same as "transactions" above, only present if include_removed=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.
   ],
   "lastblock": "lastblockhash"     (string) The hash of the block (target_confirmations-1) from the best block on the main chain. This is typically used to feed back into listsinceblock the next time you call it. So you would generally use a target_confirmations of say 6, so you will be continually re-notified of transactions until they've reached 6 confirmations plus any new ones
 }
diff --git a/listtransactions b/listtransactions
index 438677e..ef584d4 100644
--- a/listtransactions
+++ b/listtransactions
@@ -14,32 +14,38 @@ Arguments:
 Result:
 [
   {
+    "involvesWatchonly": xxx, (bool) Only returns true if imported addresses were involved in transaction.
     "address":"address",    (string) The bitcoin address of the transaction.
     "category":               (string) The transaction category.
                 "send"                  Transactions sent.
                 "receive"               Non-coinbase transactions received.
                 "generate"              Coinbase transactions received with more than 100 confirmations.
                 "immature"              Coinbase transactions received with 100 or fewer confirmations.
                 "orphan"                Orphaned coinbase transactions received.
     "amount": x.xxx,          (numeric) The amount in BTC. This is negative for the 'send' category, and is positive
                                         for all other categories
     "label": "label",       (string) A comment for the address/transaction, if any
     "vout": n,                (numeric) the vout value
     "fee": x.xxx,             (numeric) The amount of the fee in BTC. This is negative and only available for the 
                                          'send' category of transactions.
     "confirmations": n,                        (numeric) The number of confirmations for the transaction. Negative confirmations indicate the
-                                         transaction conflicts with the block chain
+                                                       transaction conflicts with the block chain.
+    "generated": xxx,                          (bool) Only returns true if transaction only input is a coinbase one, otherwise false.
     "trusted": xxx,                            (bool) Whether we consider the outputs of this unconfirmed transaction safe to spend.
     "blockhash": "hashvalue",                  (string) The block hash containing the transaction.
     "blockindex": n,                           (numeric) The index of the transaction in the block that includes it.
     "blocktime": xxx,                          (numeric) The block time in seconds since epoch (1 Jan 1970 GMT).
     "txid": "transactionid",                   (string) The transaction id.
+    "walletconflicts": [                       (array) List of txids.
+      "txid",                                  (string) The conflicting txid.
+      ...
+    ],
     "time": xxx,                               (numeric) The transaction time in seconds since epoch (midnight Jan 1 1970 GMT).
     "timereceived": xxx,                       (numeric) The time received in seconds since epoch (midnight Jan 1 1970 GMT).
-    "comment": "...",       (string) If a comment is associated with the transaction.
+    "comment": "...",                          (string) If a comment is associated with the transaction, only present if not empty.
     "bip125-replaceable": "yes|no|unknown",    (string) Whether this transaction could be replaced due to BIP125 (replace-by-fee);
                                                      may be unknown for unconfirmed transactions not in the mempool
     "abandoned": xxx          (bool) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the 
                                          'send' category of transactions.
   }
 ]

return " \"confirmations\": n, (numeric) The number of confirmations for the transaction. Negative confirmations indicate the\n"
" transaction conflicts with the block chain.\n"
" \"generated\": xxx, (bool) Only returns true if transaction only input is a coinbase one, otherwise false.\n"
" \"trusted\": xxx, (bool) Whether we consider the outputs of this unconfirmed transaction safe to spend.\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you update this to be (bool, optional) and address this comment:

if this is optional, I think the help text should also mention when the value is present or not.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rewrote comment but not sure about optional, it seems to be reserved when a optional feature is involved like HD-wallet, which is not the case with IsTrusted

@laanwj
Copy link
Member

laanwj commented Sep 30, 2019

@ariard If you'd like this to be included in 0.19, please make the suggested changes today or tomorrow, otherwise it will miss the split-off.

@laanwj laanwj removed this from the 0.19.0 milestone Oct 2, 2019
@ariard ariard force-pushed the 2019-08-missing-fields-rpcs-help branch from a0b9216 to b8d3d27 Compare October 9, 2019 16:10
@ariard
Copy link
Contributor Author

ariard commented Oct 9, 2019

Sorry for the delay, was offline for few days, updated with suggested changes at 396da1d

@ariard ariard force-pushed the 2019-08-missing-fields-rpcs-help branch from b8d3d27 to 396da1d Compare October 9, 2019 16:20
@maflcko
Copy link
Member

maflcko commented Oct 9, 2019

Rendered diff:

diff --git a/gettransaction b/gettransaction
index cf09efd..84731c7 100644
--- a/gettransaction
+++ b/gettransaction
@@ -10,39 +10,47 @@ Arguments:
 Result:
 {
     "amount" : x.xxx,        (numeric) The transaction amount in BTC
     "fee": x.xxx,            (numeric) The amount of the fee in BTC. This is negative and only available for the 
                               'send' category of transactions.
-  "confirmations" : n,     (numeric) The number of confirmations
-  "blockhash" : "hash",  (string) The block hash
-  "blockindex" : xx,       (numeric) The index of the transaction in the block that includes it
-  "blocktime" : ttt,       (numeric) The time in seconds since epoch (1 Jan 1970 GMT)
+    "confirmations": n,                        (numeric) The number of confirmations for the transaction. Negative confirmations indicate the
+                                                       transaction conflicts with the block chain.
+    "generated": xxx,                          (bool) Only present if transaction only input is a coinbase one.
+    "trusted": xxx,                            (bool) Only present if we consider transaction to be trusted and so safe to spend from.
+    "blockhash": "hashvalue",                  (string) The block hash containing the transaction.
+    "blockindex": n,                           (numeric) The index of the transaction in the block that includes it.
+    "blocktime": xxx,                          (numeric) The block time in seconds since epoch (1 Jan 1970 GMT).
     "txid": "transactionid",                   (string) The transaction id.
-  "time" : ttt,            (numeric) The transaction time in seconds since epoch (1 Jan 1970 GMT)
-  "timereceived" : ttt,    (numeric) The time received in seconds since epoch (1 Jan 1970 GMT)
+    "walletconflicts": [                       (array) Conflicting transaction ids.
+      "txid",                                  (string) The transaction id.
+      ...
+    ],
+    "time": xxx,                               (numeric) The transaction time in seconds since epoch (midnight Jan 1 1970 GMT).
+    "timereceived": xxx,                       (numeric) The time received in seconds since epoch (midnight Jan 1 1970 GMT).
+    "comment": "...",                          (string) If a comment is associated with the transaction, only present if not empty.
     "bip125-replaceable": "yes|no|unknown",    (string) Whether this transaction could be replaced due to BIP125 (replace-by-fee);
                                                      may be unknown for unconfirmed transactions not in the mempool
     "details" : [
       {
+        "involvesWatchonly": xxx,         (bool) Only returns true if imported addresses were involved in transaction.
         "address" : "address",          (string) The bitcoin address involved in the transaction
         "category" :                      (string) The transaction category.
                      "send"                  Transactions sent.
                      "receive"               Non-coinbase transactions received.
                      "generate"              Coinbase transactions received with more than 100 confirmations.
                      "immature"              Coinbase transactions received with 100 or fewer confirmations.
                      "orphan"                Orphaned coinbase transactions received.
         "amount" : x.xxx,                 (numeric) The amount in BTC
         "label" : "label",              (string) A comment for the address/transaction, if any
         "vout" : n,                       (numeric) the vout value
         "fee": x.xxx,                     (numeric) The amount of the fee in BTC. This is negative and only available for the 
                                            'send' category of transactions.
         "abandoned": xxx                  (bool) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the 
                                            'send' category of transactions.
       }
       ,...
     ],
     "hex" : "data"         (string) Raw data for transaction
     "decoded" : transaction         (json object) Optional, the decoded transaction (only present when `verbose` is passed), equivalent to the
-                                                RPC decoderawtransaction method, or the RPC getrawtransaction method when `verbose` is passed.
 }
 
 Examples:
diff --git a/listreceivedbyaddress b/listreceivedbyaddress
index 3e895f4..566ddb3 100644
--- a/listreceivedbyaddress
+++ b/listreceivedbyaddress
@@ -11,15 +11,15 @@ Arguments:
 Result:
 [
   {
-    "involvesWatchonly" : true,        (bool) Only returned if imported addresses were involved in transaction
+    "involvesWatchonly" : true,        (bool) Only returns true if imported addresses were involved in transaction.
     "address" : "receivingaddress",  (string) The receiving address
     "amount" : x.xxx,                  (numeric) The total amount in BTC received by the address
     "confirmations" : n,               (numeric) The number of confirmations of the most recent transaction included
     "label" : "label",               (string) The label of the receiving address. The default label is "".
     "txids": [
        "txid",                         (string) The ids of transactions received with the address 
        ...
     ]
   }
   ,...
 ]
diff --git a/listreceivedbylabel b/listreceivedbylabel
index 38d25bf..d716f9b 100644
--- a/listreceivedbylabel
+++ b/listreceivedbylabel
@@ -10,10 +10,10 @@ Arguments:
 Result:
 [
   {
-    "involvesWatchonly" : true,   (bool) Only returned if imported addresses were involved in transaction
+    "involvesWatchonly" : true,   (bool) Only returns true if imported addresses were involved in transaction.
     "amount" : x.xxx,             (numeric) The total amount received by addresses with this label
     "confirmations" : n,          (numeric) The number of confirmations of the most recent transaction included
     "label" : "label"           (string) The label of the receiving address. The default label is "".
   }
   ,...
 ]
diff --git a/listsinceblock b/listsinceblock
index be347aa..54f4fbf 100644
--- a/listsinceblock
+++ b/listsinceblock
@@ -14,35 +14,43 @@ Arguments:
 Result:
 {
   "transactions": [
+    "involvesWatchonly": xxx, (bool) Only returns true if imported addresses were involved in transaction.
     "address":"address",    (string) The bitcoin address of the transaction.
     "category":               (string) The transaction category.
                 "send"                  Transactions sent.
                 "receive"               Non-coinbase transactions received.
                 "generate"              Coinbase transactions received with more than 100 confirmations.
                 "immature"              Coinbase transactions received with 100 or fewer confirmations.
                 "orphan"                Orphaned coinbase transactions received.
     "amount": x.xxx,          (numeric) The amount in BTC. This is negative for the 'send' category, and is positive
                                          for all other categories
     "vout" : n,               (numeric) the vout value
     "fee": x.xxx,             (numeric) The amount of the fee in BTC. This is negative and only available for the 'send' category of transactions.
-    "confirmations": n,       (numeric) The number of confirmations for the transaction.
-                                          When it's < 0, it means the transaction conflicted that many blocks ago.
+    "confirmations": n,                        (numeric) The number of confirmations for the transaction. Negative confirmations indicate the
+                                                       transaction conflicts with the block chain.
+    "generated": xxx,                          (bool) Only present if transaction only input is a coinbase one.
+    "trusted": xxx,                            (bool) Only present if we consider transaction to be trusted and so safe to spend from.
     "blockhash": "hashvalue",                  (string) The block hash containing the transaction.
     "blockindex": n,                           (numeric) The index of the transaction in the block that includes it.
     "blocktime": xxx,                          (numeric) The block time in seconds since epoch (1 Jan 1970 GMT).
     "txid": "transactionid",                   (string) The transaction id.
-    "time": xxx,              (numeric) The transaction time in seconds since epoch (Jan 1 1970 GMT).
-    "timereceived": xxx,      (numeric) The time received in seconds since epoch (Jan 1 1970 GMT).
+    "walletconflicts": [                       (array) Conflicting transaction ids.
+      "txid",                                  (string) The transaction id.
+      ...
+    ],
+    "time": xxx,                               (numeric) The transaction time in seconds since epoch (midnight Jan 1 1970 GMT).
+    "timereceived": xxx,                       (numeric) The time received in seconds since epoch (midnight Jan 1 1970 GMT).
+    "comment": "...",                          (string) If a comment is associated with the transaction, only present if not empty.
     "bip125-replaceable": "yes|no|unknown",    (string) Whether this transaction could be replaced due to BIP125 (replace-by-fee);
                                                      may be unknown for unconfirmed transactions not in the mempool
     "abandoned": xxx,         (bool) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the 'send' category of transactions.
     "comment": "...",       (string) If a comment is associated with the transaction.
     "label" : "label"       (string) A comment for the address/transaction, if any
     "to": "...",            (string) If a comment to is associated with the transaction.
   ],
   "removed": [
     <structure is the same as "transactions" above, only present if include_removed=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.
   ],
   "lastblock": "lastblockhash"     (string) The hash of the block (target_confirmations-1) from the best block on the main chain. This is typically used to feed back into listsinceblock the next time you call it. So you would generally use a target_confirmations of say 6, so you will be continually re-notified of transactions until they've reached 6 confirmations plus any new ones
 }
diff --git a/listtransactions b/listtransactions
index 438677e..63249dc 100644
--- a/listtransactions
+++ b/listtransactions
@@ -14,32 +14,38 @@ Arguments:
 Result:
 [
   {
+    "involvesWatchonly": xxx, (bool) Only returns true if imported addresses were involved in transaction.
     "address":"address",    (string) The bitcoin address of the transaction.
     "category":               (string) The transaction category.
                 "send"                  Transactions sent.
                 "receive"               Non-coinbase transactions received.
                 "generate"              Coinbase transactions received with more than 100 confirmations.
                 "immature"              Coinbase transactions received with 100 or fewer confirmations.
                 "orphan"                Orphaned coinbase transactions received.
     "amount": x.xxx,          (numeric) The amount in BTC. This is negative for the 'send' category, and is positive
                                         for all other categories
     "label": "label",       (string) A comment for the address/transaction, if any
     "vout": n,                (numeric) the vout value
     "fee": x.xxx,             (numeric) The amount of the fee in BTC. This is negative and only available for the 
                                          'send' category of transactions.
     "confirmations": n,                        (numeric) The number of confirmations for the transaction. Negative confirmations indicate the
-                                         transaction conflicts with the block chain
-    "trusted": xxx,           (bool) Whether we consider the outputs of this unconfirmed transaction safe to spend.
+                                                       transaction conflicts with the block chain.
+    "generated": xxx,                          (bool) Only present if transaction only input is a coinbase one.
+    "trusted": xxx,                            (bool) Only present if we consider transaction to be trusted and so safe to spend from.
     "blockhash": "hashvalue",                  (string) The block hash containing the transaction.
     "blockindex": n,                           (numeric) The index of the transaction in the block that includes it.
     "blocktime": xxx,                          (numeric) The block time in seconds since epoch (1 Jan 1970 GMT).
     "txid": "transactionid",                   (string) The transaction id.
+    "walletconflicts": [                       (array) Conflicting transaction ids.
+      "txid",                                  (string) The transaction id.
+      ...
+    ],
     "time": xxx,                               (numeric) The transaction time in seconds since epoch (midnight Jan 1 1970 GMT).
     "timereceived": xxx,                       (numeric) The time received in seconds since epoch (midnight Jan 1 1970 GMT).
-    "comment": "...",       (string) If a comment is associated with the transaction.
+    "comment": "...",                          (string) If a comment is associated with the transaction, only present if not empty.
     "bip125-replaceable": "yes|no|unknown",    (string) Whether this transaction could be replaced due to BIP125 (replace-by-fee);
                                                      may be unknown for unconfirmed transactions not in the mempool
     "abandoned": xxx          (bool) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the 
                                          'send' category of transactions.
   }
 ]

" ],\n"
" \"hex\" : \"data\" (string) Raw data for transaction\n"
" \"decoded\" : transaction (json object) Optional, the decoded transaction (only present when `verbose` is passed), equivalent to the\n"
" RPC decoderawtransaction method, or the RPC getrawtransaction method when `verbose` is passed.\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected

" ...\n"
" ],\n"
" \"time\": xxx, (numeric) The transaction time in seconds since epoch (midnight Jan 1 1970 GMT).\n"
" \"timereceived\": xxx, (numeric) The time received in seconds since epoch (midnight Jan 1 1970 GMT).\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say to remove midnight, because we don't use that nomenclature anywhere else

@maflcko
Copy link
Member

maflcko commented Oct 9, 2019

ACK 396da1d

Show signature and timestamp

Signature:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

ACK 396da1d8a2ab9c2bd026eece0186b6e9d8c3181c
-----BEGIN PGP SIGNATURE-----

iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
pUgcPwv9Gk7KN8Dns6Yj8kdYXui6m+gX2AGVTaROZKRgRXX4ZJao4qrp1cuZABH7
8CRVd8ozqDCPHxupSjxidfDXGvWgiKbhwnfDvNy++wg94UpO9GchUFPAUYg/H/4b
PQIKLN5kE0CgSFI1e4yM6PW/I34VW8Aeh5K1d/PKW7560ZgnHAppOVxDZP3XPNiW
qVYQHDNn/HVGO1G4OORpDr5d7cHbxV92fI1iR0xki2m1hvAlBiwQlDNiBfIvd2hA
mS5PYZHa7NtyvLuLDPiVsY1KWBONXJr9bGfM5mKrdDIOO/Rp+/E0GpladfZGokTy
Y87e3ow1KcrB1hB/wz8NngkC11W1bEievKSQjP34aXJL8DSoO2w3Jj3x0vQxuor3
y8HU6OteEk2uPn0Y0yR2l+6sHdnnrbUKzWdboIgsSvNjW8oZ7lF8gIxf4wQLNG6h
7bc5Itzel/RI8BC2abmLKx9uIUNpLKy/DDDdW8pF3d7qYeGPQX7yxAP835CyGY9z
W4vkc8g5
=/J2v
-----END PGP SIGNATURE-----

Timestamp of file with hash 3a1dd9f9738323e22f94da416a4b83f73c9e03313d0758b17e388c2938fda613 -

Antoine Riard added 2 commits October 9, 2019 14:22
Fields involvesWatchonly, generated, walletconflicts were missing
in result description of listtransactions, listsinceblock,
gettransaction

Align getttransaction fields which were odd compare to other rpc
helpers
@ariard ariard force-pushed the 2019-08-missing-fields-rpcs-help branch from 396da1d to f4c8953 Compare October 9, 2019 18:28
@maflcko
Copy link
Member

maflcko commented Oct 9, 2019

re-ACK f4c8953 (only change is addressing my nits)

Show signature and timestamp

Signature:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

re-ACK f4c8953b0073e6bc37abd18ec4a5cbc3ea9719a1 (only change is addressing my nits)
-----BEGIN PGP SIGNATURE-----

iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
pUhooAwArU21TEvHAToY40eahPE8pCMTN+GSNBaJxtV3/sk2RC6M3h8R+nR78cqa
gN8Qmz4tYENU02ZlnjpfPYjMyh57L8baz/evdb8dzmFd25L59MYBeBggrYWzZ0BF
4mUbl5QEka/tal1dWmoFOK6IR1vVG8CWepH4nyO7qHe3pfeyft+5Dz8IFSG2Uuro
SwhGysluURvuBYZg5aFVazUVSbcuPEzE1EPVRbRJ0CupYwpCnnyabBTdIJrt2nXI
m7vX+301k/wl0zDIyOlK1lRf35C6YTXxgUbmHTrRHrvzVeK42aWUFS2JXJ0MPZW1
ZL4YG3YoLqtfDDVju63E/NOp1rhKIeI8NaHC4qpa8kZeaFoSN1tSdmISgCmftb4P
0rKPyk6Bks5aPNVYTJz9ynuiIuXm599D3o+2D0irx/J/whpk1+EYttAqR0kRjYVv
v5lxfSQ4SeomOnI+hkXkT/Q+ZiMo9TPW6qDQBOo8/1u/hae1Ex9gDqtEA83VBi8J
92CT+k4S
=qvS9
-----END PGP SIGNATURE-----

Timestamp of file with hash fbe29a11ac2d81f0f51edc5354e77b0c147b5e6692a6c02189c7fa41db6287cf -

Copy link
Contributor

@kristapsk kristapsk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK f4c8953

maflcko pushed a commit that referenced this pull request Oct 10, 2019
f4c8953 Add missing fields in TransactionDescriptionString and others (Antoine Riard)
3530108 MOVEONLY : move RPC wallets helpers to TransactionDescriptionString (Antoine Riard)

Pull request description:

  Knowledge of `walletconflicts` field existence is really nice when you're debugging conflicts. Was added in #3671 but never documented in RPC helps.

  Others were added after a quick skim, we may still have missing ones in wallet rpcs.

ACKs for top commit:
  MarcoFalke:
    re-ACK f4c8953 (only change is addressing my nits)
  kristapsk:
    ACK f4c8953

Tree-SHA512: 2bea4d8743399fb152f942df7454548b896b2ad5654fd4bf60253afec1a5387ef8797ced97776dc7ba4912291263c08abe7c2b608c6a28f9a0df67be4ebc4635
@maflcko maflcko merged commit f4c8953 into bitcoin:master Oct 10, 2019
MarkLTZ added a commit to litecoinz-core/litecoinz that referenced this pull request Nov 17, 2019
jasonbcox pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Sep 8, 2020
…onDescriptionString

Summary:
bitcoin/bitcoin@3530108

---

Partial backport of Core [[bitcoin/bitcoin#16689 | PR16689]]

Test Plan:
  ninja
  bitcoin-cli help listtransactions|listsinceblock|gettransaction

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D7384
jasonbcox pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Sep 8, 2020
…ng and others

Summary:
Fields involvesWatchonly, generated, walletconflicts were missing
in result description of listtransactions, listsinceblock,
gettransaction

Align getttransaction fields which were odd compare to other rpc
helpers

bitcoin/bitcoin@f4c8953

---

Depends on D7384

Concludes backport of Core [[bitcoin/bitcoin#16689 | PR16689]]

Test Plan:
  ninja
  bitcoin-cli help listreceivedbyaddress|listreceivedbylabel|listtransactions|listsinceblock|gettransaction

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D7385
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.