Skip to content

Commit 39f861a

Browse files
Antoine Riardmajcosta
Antoine Riard
authored andcommitted
[backport#16689 2/2] Add missing fields in TransactionDescriptionString 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
1 parent 179ffbc commit 39f861a

File tree

1 file changed

+54
-38
lines changed

1 file changed

+54
-38
lines changed

src/wallet/rpcwallet.cpp

+54-38
Original file line numberDiff line numberDiff line change
@@ -1351,8 +1351,8 @@ static UniValue listreceivedbyaddress(const Config &config,
13511351
RPCResult{
13521352
"[\n"
13531353
" {\n"
1354-
" \"involvesWatchonly\" : true, (bool) Only returned if "
1355-
"imported addresses were involved in transaction\n"
1354+
" \"involvesWatchonly\" : true, (bool) Only returns true "
1355+
"if imported addresses were involved in transaction\n"
13561356
" \"address\" : \"receivingaddress\", (string) The receiving "
13571357
"address\n"
13581358
" \"amount\" : x.xxx, (numeric) The total "
@@ -1415,8 +1415,8 @@ static UniValue listreceivedbylabel(const Config &config,
14151415
},
14161416
RPCResult{"[\n"
14171417
" {\n"
1418-
" \"involvesWatchonly\" : true, (bool) Only returned if "
1419-
"imported addresses were involved in transaction\n"
1418+
" \"involvesWatchonly\" : true, (bool) Only returns "
1419+
"true if imported addresses were involved in transaction\n"
14201420
" \"amount\" : x.xxx, (numeric) The total "
14211421
"amount received by addresses with this label\n"
14221422
" \"confirmations\" : n, (numeric) The number of "
@@ -1546,9 +1546,11 @@ static const std::string TransactionDescriptionString() {
15461546
"confirmations means the\n"
15471547
" transaction "
15481548
"conflicted that many blocks ago.\n"
1549-
" \"trusted\": xxx, (bool) Whether we "
1550-
"consider the outputs of this unconfirmed transaction safe to "
1551-
"spend.\n"
1549+
" \"generated\": xxx, (bool) Only "
1550+
"present if transaction only input is a coinbase one.\n"
1551+
" \"trusted\": xxx, (bool) Only "
1552+
"present if we consider transaction to be trusted and so safe to "
1553+
"spend from.\n"
15521554
" \"blockhash\": \"hashvalue\", (string) The "
15531555
"block hash containing the transaction.\n"
15541556
" \"blockindex\": n, (numeric) The "
@@ -1557,6 +1559,12 @@ static const std::string TransactionDescriptionString() {
15571559
"block time in seconds since epoch (1 Jan 1970 GMT).\n"
15581560
" \"txid\": \"transactionid\", (string) The "
15591561
"transaction id.\n"
1562+
" \"walletconflicts\": [ (array) "
1563+
"Conflicting transaction ids.\n"
1564+
" \"txid\", (string) The "
1565+
"transaction id.\n"
1566+
" ...\n"
1567+
" ],\n"
15601568
" \"time\": xxx, (numeric) The "
15611569
"transaction time in seconds since epoch (midnight Jan 1 1970 "
15621570
"GMT).\n"
@@ -1598,6 +1606,8 @@ UniValue listtransactions(const Config &config, const JSONRPCRequest &request) {
15981606
RPCResult{
15991607
"[\n"
16001608
" {\n"
1609+
" \"involvesWatchonly\": xxx, (bool) Only returns true if "
1610+
"imported addresses were involved in transaction.\n"
16011611
" \"address\":\"address\", (string) The bitcoin address of "
16021612
"the transaction.\n"
16031613
" \"category\": (string) The transaction "
@@ -1750,6 +1760,8 @@ static UniValue listsinceblock(const Config &config,
17501760
RPCResult{
17511761
"{\n"
17521762
" \"transactions\": [\n"
1763+
" \"involvesWatchonly\": xxx, (bool) Only returns true if "
1764+
"imported addresses were involved in transaction.\n"
17531765
" \"address\":\"address\", (string) The bitcoin address of "
17541766
"the transaction.\n"
17551767
" \"category\": (string) The transaction "
@@ -1929,57 +1941,61 @@ static UniValue gettransaction(const Config &config,
19291941
},
19301942
RPCResult{
19311943
"{\n"
1932-
" \"amount\" : x.xxx, (numeric) The transaction amount "
1944+
" \"amount\" : x.xxx, (numeric) The transaction amount "
19331945
"in " +
19341946
CURRENCY_UNIT +
19351947
"\n"
1936-
" \"fee\": x.xxx, (numeric) The amount of the fee in " +
1948+
" \"fee\": x.xxx, (numeric) The amount of the fee "
1949+
"in " +
19371950
CURRENCY_UNIT +
19381951
". This is negative and only available for the \n"
19391952
" 'send' category of transactions.\n" +
19401953
TransactionDescriptionString() +
1941-
" \"details\" : [\n"
1942-
" {\n"
1943-
" \"address\" : \"address\", (string) The bitcoin "
1944-
"address involved in the transaction\n"
1945-
" \"category\" : (string) The "
1946-
"transaction category.\n"
1947-
" \"send\" Transactions sent.\n"
1948-
" \"receive\" Non-coinbase "
1949-
"transactions received.\n"
1950-
" \"generate\" Coinbase "
1951-
"transactions received with more than 100 confirmations.\n"
1952-
" \"immature\" Coinbase "
1953-
"transactions received with 100 or fewer confirmations.\n"
1954-
" \"orphan\" Orphaned coinbase "
1955-
"transactions received.\n"
1956-
" \"amount\" : x.xxx, (numeric) The amount "
1957-
"in " +
1954+
+" \"details\" : [\n"
1955+
" {\n"
1956+
" \"involvesWatchonly\": xxx, (bool) Only returns "
1957+
"true if imported addresses were involved in transaction.\n"
1958+
" \"address\" : \"address\", (string) The bitcoin "
1959+
"address involved in the transaction\n"
1960+
" \"category\" : (string) The "
1961+
"transaction category.\n"
1962+
" \"send\" Transactions "
1963+
"sent.\n"
1964+
" \"receive\" Non-coinbase "
1965+
"transactions received.\n"
1966+
" \"generate\" Coinbase "
1967+
"transactions received with more than 100 confirmations.\n"
1968+
" \"immature\" Coinbase "
1969+
"transactions received with 100 or fewer confirmations.\n"
1970+
" \"orphan\" Orphaned coinbase "
1971+
"transactions received.\n"
1972+
" \"amount\" : x.xxx, (numeric) The amount "
1973+
"in " +
19581974
CURRENCY_UNIT +
19591975
"\n"
1960-
" \"label\" : \"label\", (string) A comment for "
1961-
"the address/transaction, if any\n"
1962-
" \"vout\" : n, (numeric) the vout "
1976+
" \"label\" : \"label\", (string) A comment "
1977+
"for the address/transaction, if any\n"
1978+
" \"vout\" : n, (numeric) the vout "
19631979
"value\n"
1964-
" \"fee\": x.xxx, (numeric) The amount of "
1965-
"the fee in " +
1980+
" \"fee\": x.xxx, (numeric) The amount "
1981+
"of the fee in " +
19661982
CURRENCY_UNIT +
19671983
". This is negative and only available for the \n"
19681984
" 'send' category of "
19691985
"transactions.\n"
1970-
" \"abandoned\": xxx (bool) 'true' if the "
1986+
" \"abandoned\": xxx (bool) 'true' if the "
19711987
"transaction has been abandoned (inputs are respendable). Only "
19721988
"available for the \n"
19731989
" 'send' category of "
19741990
"transactions.\n"
1975-
" }\n"
1976-
" ,...\n"
1977-
" ],\n"
1978-
" \"hex\" : \"data\" (string) Raw data for transaction\n"
1979-
" \"decoded\" : transaction (json object) Optional, the "
1991+
" }\n"
1992+
" ,...\n"
1993+
" ],\n"
1994+
" \"hex\" : \"data\" (string) Raw data for transaction\n"
1995+
" \"decoded\" : transaction (json object) Optional, the "
19801996
"decoded transaction (only present when `verbose` is passed), "
19811997
"equivalent to the\n"
1982-
" RPC "
1998+
" RPC "
19831999
"decoderawtransaction method, or the RPC getrawtransaction method "
19842000
"when `verbose` is passed.\n"
19852001
"}\n"},

0 commit comments

Comments
 (0)