Skip to content

Commit f4c8953

Browse files
author
Antoine Riard
committed
Add missing fields in TransactionDescriptionString and others
Fields involvesWatchonly, generated, walletconflicts were missing in result description of listtransactions, listsinceblock, gettransaction Align getttransaction fields which were odd compare to other rpc helpers
1 parent 3530108 commit f4c8953

File tree

1 file changed

+33
-25
lines changed

1 file changed

+33
-25
lines changed

src/wallet/rpcwallet.cpp

+33-25
Original file line numberDiff line numberDiff line change
@@ -1190,7 +1190,7 @@ static UniValue listreceivedbyaddress(const JSONRPCRequest& request)
11901190
RPCResult{
11911191
"[\n"
11921192
" {\n"
1193-
" \"involvesWatchonly\" : true, (bool) Only returned if imported addresses were involved in transaction\n"
1193+
" \"involvesWatchonly\" : true, (bool) Only returns true if imported addresses were involved in transaction.\n"
11941194
" \"address\" : \"receivingaddress\", (string) The receiving address\n"
11951195
" \"amount\" : x.xxx, (numeric) The total amount in " + CURRENCY_UNIT + " received by the address\n"
11961196
" \"confirmations\" : n, (numeric) The number of confirmations of the most recent transaction included\n"
@@ -1240,7 +1240,7 @@ static UniValue listreceivedbylabel(const JSONRPCRequest& request)
12401240
RPCResult{
12411241
"[\n"
12421242
" {\n"
1243-
" \"involvesWatchonly\" : true, (bool) Only returned if imported addresses were involved in transaction\n"
1243+
" \"involvesWatchonly\" : true, (bool) Only returns true if imported addresses were involved in transaction.\n"
12441244
" \"amount\" : x.xxx, (numeric) The total amount received by addresses with this label\n"
12451245
" \"confirmations\" : n, (numeric) The number of confirmations of the most recent transaction included\n"
12461246
" \"label\" : \"label\" (string) The label of the receiving address. The default label is \"\".\n"
@@ -1363,11 +1363,16 @@ static const std::string TransactionDescriptionString()
13631363
{
13641364
return " \"confirmations\": n, (numeric) The number of confirmations for the transaction. Negative confirmations means the\n"
13651365
" transaction conflicted that many blocks ago.\n"
1366-
" \"trusted\": xxx, (bool) Whether we consider the outputs of this unconfirmed transaction safe to spend.\n"
1366+
" \"generated\": xxx, (bool) Only present if transaction only input is a coinbase one.\n"
1367+
" \"trusted\": xxx, (bool) Only present if we consider transaction to be trusted and so safe to spend from.\n"
13671368
" \"blockhash\": \"hashvalue\", (string) The block hash containing the transaction.\n"
13681369
" \"blockindex\": n, (numeric) The index of the transaction in the block that includes it.\n"
13691370
" \"blocktime\": xxx, (numeric) The block time in seconds since epoch (1 Jan 1970 GMT).\n"
13701371
" \"txid\": \"transactionid\", (string) The transaction id.\n"
1372+
" \"walletconflicts\": [ (array) Conflicting transaction ids.\n"
1373+
" \"txid\", (string) The transaction id.\n"
1374+
" ...\n"
1375+
" ],\n"
13711376
" \"time\": xxx, (numeric) The transaction time in seconds since epoch (midnight Jan 1 1970 GMT).\n"
13721377
" \"timereceived\": xxx, (numeric) The time received in seconds since epoch (midnight Jan 1 1970 GMT).\n"
13731378
" \"comment\": \"...\", (string) If a comment is associated with the transaction, only present if not empty.\n"
@@ -1397,6 +1402,7 @@ UniValue listtransactions(const JSONRPCRequest& request)
13971402
RPCResult{
13981403
"[\n"
13991404
" {\n"
1405+
" \"involvesWatchonly\": xxx, (bool) Only returns true if imported addresses were involved in transaction.\n"
14001406
" \"address\":\"address\", (string) The bitcoin address of the transaction.\n"
14011407
" \"category\": (string) The transaction category.\n"
14021408
" \"send\" Transactions sent.\n"
@@ -1520,6 +1526,7 @@ static UniValue listsinceblock(const JSONRPCRequest& request)
15201526
RPCResult{
15211527
"{\n"
15221528
" \"transactions\": [\n"
1529+
" \"involvesWatchonly\": xxx, (bool) Only returns true if imported addresses were involved in transaction.\n"
15231530
" \"address\":\"address\", (string) The bitcoin address of the transaction.\n"
15241531
" \"category\": (string) The transaction category.\n"
15251532
" \"send\" Transactions sent.\n"
@@ -1651,32 +1658,33 @@ static UniValue gettransaction(const JSONRPCRequest& request)
16511658
},
16521659
RPCResult{
16531660
"{\n"
1654-
" \"amount\" : x.xxx, (numeric) The transaction amount in " + CURRENCY_UNIT + "\n"
1655-
" \"fee\": x.xxx, (numeric) The amount of the fee in " + CURRENCY_UNIT + ". This is negative and only available for the \n"
1661+
" \"amount\" : x.xxx, (numeric) The transaction amount in " + CURRENCY_UNIT + "\n"
1662+
" \"fee\": x.xxx, (numeric) The amount of the fee in " + CURRENCY_UNIT + ". This is negative and only available for the \n"
16561663
" 'send' category of transactions.\n"
16571664
+ TransactionDescriptionString()
1658-
+ " \"details\" : [\n"
1659-
" {\n"
1660-
" \"address\" : \"address\", (string) The bitcoin address involved in the transaction\n"
1661-
" \"category\" : (string) The transaction category.\n"
1662-
" \"send\" Transactions sent.\n"
1663-
" \"receive\" Non-coinbase transactions received.\n"
1664-
" \"generate\" Coinbase transactions received with more than 100 confirmations.\n"
1665-
" \"immature\" Coinbase transactions received with 100 or fewer confirmations.\n"
1666-
" \"orphan\" Orphaned coinbase transactions received.\n"
1667-
" \"amount\" : x.xxx, (numeric) The amount in " + CURRENCY_UNIT + "\n"
1668-
" \"label\" : \"label\", (string) A comment for the address/transaction, if any\n"
1669-
" \"vout\" : n, (numeric) the vout value\n"
1670-
" \"fee\": x.xxx, (numeric) The amount of the fee in " + CURRENCY_UNIT + ". This is negative and only available for the \n"
1665+
+ " \"details\" : [\n"
1666+
" {\n"
1667+
" \"involvesWatchonly\": xxx, (bool) Only returns true if imported addresses were involved in transaction.\n"
1668+
" \"address\" : \"address\", (string) The bitcoin address involved in the transaction\n"
1669+
" \"category\" : (string) The transaction category.\n"
1670+
" \"send\" Transactions sent.\n"
1671+
" \"receive\" Non-coinbase transactions received.\n"
1672+
" \"generate\" Coinbase transactions received with more than 100 confirmations.\n"
1673+
" \"immature\" Coinbase transactions received with 100 or fewer confirmations.\n"
1674+
" \"orphan\" Orphaned coinbase transactions received.\n"
1675+
" \"amount\" : x.xxx, (numeric) The amount in " + CURRENCY_UNIT + "\n"
1676+
" \"label\" : \"label\", (string) A comment for the address/transaction, if any\n"
1677+
" \"vout\" : n, (numeric) the vout value\n"
1678+
" \"fee\": x.xxx, (numeric) The amount of the fee in " + CURRENCY_UNIT + ". This is negative and only available for the \n"
16711679
" 'send' category of transactions.\n"
1672-
" \"abandoned\": xxx (bool) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the \n"
1680+
" \"abandoned\": xxx (bool) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the \n"
16731681
" 'send' category of transactions.\n"
1674-
" }\n"
1675-
" ,...\n"
1676-
" ],\n"
1677-
" \"hex\" : \"data\" (string) Raw data for transaction\n"
1678-
" \"decoded\" : transaction (json object) Optional, the decoded transaction (only present when `verbose` is passed), equivalent to the\n"
1679-
" RPC decoderawtransaction method, or the RPC getrawtransaction method when `verbose` is passed.\n"
1682+
" }\n"
1683+
" ,...\n"
1684+
" ],\n"
1685+
" \"hex\" : \"data\" (string) Raw data for transaction\n"
1686+
" \"decoded\" : transaction (json object) Optional, the decoded transaction (only present when `verbose` is passed), equivalent to the\n"
1687+
" RPC decoderawtransaction method, or the RPC getrawtransaction method when `verbose` is passed.\n"
16801688
"}\n"
16811689
},
16821690
RPCExamples{

0 commit comments

Comments
 (0)