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.
1401 | " \"trusted\": xxx, (bool) Whether we consider the outputs of this unconfirmed transaction safe to spend.\n"
1402 | " \"blockhash\": \"hashvalue\", (string) The block hash containing the transaction.\n"
1403 | " \"blockindex\": n, (numeric) The index of the transaction in the block that includes it.\n"
1404 | " \"blocktime\": xxx, (numeric) The block time in seconds since epoch (1 Jan 1970 GMT).\n"
1405 | " \"txid\": \"transactionid\", (string) The transaction id.\n"
1406 | + " \"walletconflicts:\"hashvalue\", (array) List of txid with which this transaction is conflicting.\n"
nit: missing a space after the : here.
1380 | @@ -1381,6 +1381,7 @@ UniValue listtransactions(const JSONRPCRequest& request) 1381 | RPCResult{ 1382 | "[\n" 1383 | " {\n" 1384 | + " \"involvesWatchonly\": xxx, (bool) Only returned if imported addresses were involved in transaction\n"
I'd rather pull this out into a static const RPCResult in a moveonly commit, since it is used in three places. And then only update that single place with the documentation. We do that in other places (like getmempoolentry)
Agree.
Concept ACK
1396 | @@ -1396,11 +1397,13 @@ UniValue listtransactions(const JSONRPCRequest& request) 1397 | " 'send' category of transactions.\n" 1398 | " \"confirmations\": n, (numeric) The number of confirmations for the transaction. Negative confirmations indicate the\n" 1399 | " transaction conflicts with the block chain\n" 1400 | + " \"generated\": xxx, (bool) Only returns true if transaction is a coinbase one\n"
The coinbase is the input. The output is simply generated.
Doesn't a transaction including a coinbase input qualify as a coinbase one ? We don't enforce this wording strictly if the rest of the codebase I think.
Updated at fbc3c9f as suggested in #16689 (review) (but only output from WalletTxToJSON as we may have small diffs between RPCs for other fields)
1410 | @@ -1393,19 +1411,8 @@ UniValue listtransactions(const JSONRPCRequest& request) 1411 | " \"label\": \"label\", (string) A comment for the address/transaction, if any\n" 1412 | " \"vout\": n, (numeric) the vout value\n" 1413 | " \"fee\": x.xxx, (numeric) The amount of the fee in " + CURRENCY_UNIT + ". This is negative and only available for the \n" 1414 | - " 'send' category of transactions.\n"
This line should not be deleted.
1358 | @@ -1359,6 +1359,23 @@ static void ListTransactions(interfaces::Chain::Lock& locked_chain, CWallet* con 1359 | } 1360 | } 1361 | 1362 | +static const std::string TransactionDescriptionString() 1363 | +{ 1364 | + return " \"confirmations\": n, (numeric) The number of confirmations for the transaction. Negative confirmations indicate the\n" 1365 | + " transaction conflicts with the block chain\n"
While extracting this, it wouldn't hurt to fixup the nits that wouldn't be worth a commit on their own, like adding the missing period at the end of this sentence and next sentence.
e.g. s/chain\n"/chain.\n"/ and s/one\n"/one.\n"/
Suggestion: s/Only returns true if transaction is a coinbase one./True if the transaction is a coinbase, otherwise false./
Though #16689 (review) should be handled first.
It would be nice to align the horizontal spacing of this entire section.
1367 | + " \"trusted\": xxx, (bool) Whether we consider the outputs of this unconfirmed transaction safe to spend.\n" 1368 | + " \"blockhash\": \"hashvalue\", (string) The block hash containing the transaction.\n" 1369 | + " \"blockindex\": n, (numeric) The index of the transaction in the block that includes it.\n" 1370 | + " \"blocktime\": xxx, (numeric) The block time in seconds since epoch (1 Jan 1970 GMT).\n" 1371 | + " \"txid\": \"transactionid\", (string) The transaction id.\n" 1372 | + " \"walletconflicts: \"hashvalue\", (array) List of txid with which this transaction is conflicting.\n"
Grammar fix: s/List of txid with which this transaction is conflicting./List of txids that conflict with this transaction./
1423 | - " \"timereceived\": xxx, (numeric) The time received in seconds since epoch (midnight Jan 1 1970 GMT).\n" 1424 | - " \"comment\": \"...\", (string) If a comment is associated with the transaction.\n" 1425 | - " \"bip125-replaceable\": \"yes|no|unknown\", (string) Whether this transaction could be replaced due to BIP125 (replace-by-fee);\n" 1426 | - " may be unknown for unconfirmed transactions not in the mempool\n" 1427 | + + TransactionDescriptionString() 1428 | + + " 'send' category of transactions.\n"
Other half of #16689 (review). This line should be moved to before TransactionDescriptionString() -- it's in the wrong place.
1521 | @@ -1515,6 +1522,7 @@ static UniValue listsinceblock(const JSONRPCRequest& request) 1522 | RPCResult{ 1523 | "{\n" 1524 | " \"transactions\": [\n" 1525 | + " \"involvesWatchonly\": xxx, (bool) Only returned if imported addresses were involved in transaction\n"
"Only returned" means what? Maybe it's just me, but this and the rest of the sentence isn't clear.
nit: missing period at end of sentence.
1665 | - " may be unknown for unconfirmed transactions not in the mempool\n" 1666 | - " \"details\" : [\n" 1667 | + + TransactionDescriptionString() 1668 | + + " \"details\" : [\n" 1669 | " {\n" 1670 | + " \"involvesWatchonly\": xxx, (bool) Only returned if imported addresses were involved in transaction\n"
Same here as for the identical line above #16689 (review).
1543 | - " \"time\": xxx, (numeric) The transaction time in seconds since epoch (Jan 1 1970 GMT).\n" 1544 | - " \"timereceived\": xxx, (numeric) The time received in seconds since epoch (Jan 1 1970 GMT).\n" 1545 | - " \"bip125-replaceable\": \"yes|no|unknown\", (string) Whether this transaction could be replaced due to BIP125 (replace-by-fee);\n" 1546 | - " may be unknown for unconfirmed transactions not in the mempool\n" 1547 | - " \"abandoned\": xxx, (bool) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the 'send' category of transactions.\n" 1548 | + + TransactionDescriptionString()
nit: It looks like you added a tab at the start of this line.
1422 | - " \"time\": xxx, (numeric) The transaction time in seconds since epoch (midnight Jan 1 1970 GMT).\n" 1423 | - " \"timereceived\": xxx, (numeric) The time received in seconds since epoch (midnight Jan 1 1970 GMT).\n" 1424 | - " \"comment\": \"...\", (string) If a comment is associated with the transaction.\n" 1425 | - " \"bip125-replaceable\": \"yes|no|unknown\", (string) Whether this transaction could be replaced due to BIP125 (replace-by-fee);\n" 1426 | - " may be unknown for unconfirmed transactions not in the mempool\n" 1427 | + + TransactionDescriptionString()
nit: It looks like you've added a tab at the start of this line.
1662 | - " \"time\" : ttt, (numeric) The transaction time in seconds since epoch (1 Jan 1970 GMT)\n" 1663 | - " \"timereceived\" : ttt, (numeric) The time received in seconds since epoch (1 Jan 1970 GMT)\n" 1664 | - " \"bip125-replaceable\": \"yes|no|unknown\", (string) Whether this transaction could be replaced due to BIP125 (replace-by-fee);\n" 1665 | - " may be unknown for unconfirmed transactions not in the mempool\n" 1666 | - " \"details\" : [\n" 1667 | + + TransactionDescriptionString()
nit: another tab.
1544 | - " \"timereceived\": xxx, (numeric) The time received in seconds since epoch (Jan 1 1970 GMT).\n" 1545 | - " \"bip125-replaceable\": \"yes|no|unknown\", (string) Whether this transaction could be replaced due to BIP125 (replace-by-fee);\n" 1546 | - " may be unknown for unconfirmed transactions not in the mempool\n" 1547 | - " \"abandoned\": xxx, (bool) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the 'send' category of transactions.\n" 1548 | + + TransactionDescriptionString() 1549 | + + " \"abandoned\": xxx, (bool) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the 'send' category of transactions.\n"
s/'true'/True/
Possibly: s/Only available for/Only applies to/
Concept ACK.
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
No conflicts as of last run.
1363 | +{ 1364 | + return " \"confirmations\": n, (numeric) The number of confirmations for the transaction. Negative confirmations indicate the\n" 1365 | + " transaction conflicts with the block chain.\n" 1366 | + " \"generated\": xxx, (bool) Only returns true if transaction only input is a coinbase one, otherwise false.\n" 1367 | + " \"trusted\": xxx, (bool) Whether we consider the outputs of this unconfirmed transaction safe to spend.\n" 1368 | + " \"blockhash\": \"hashvalue\", (string) The block hash containing the transaction.\n"
nit, try to have it aligned with surrounding lines.
You mean blockhash compare to trusted and others ? Don't get the misalignment here
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)
1416 | - " \"blockindex\": n, (numeric) The index of the transaction in the block that includes it.\n" 1417 | - " \"blocktime\": xxx, (numeric) The block time in seconds since epoch (1 Jan 1970 GMT).\n" 1418 | - " \"txid\": \"transactionid\", (string) The transaction id.\n" 1419 | - " \"time\": xxx, (numeric) The transaction time in seconds since epoch (midnight Jan 1 1970 GMT).\n" 1420 | - " \"timereceived\": xxx, (numeric) The time received in seconds since epoch (midnight Jan 1 1970 GMT).\n" 1421 | - " \"comment\": \"...\", (string) If a comment is associated with the transaction.\n"
Not sure if this was a deliberate removal but comment is still a field which might be present, among others.
for (const std::pair<const std::string, std::string>& item : wtx.mapValue)
entry.pushKV(item.first, item.second);
(From WalletTxToJSON)
Good catch, could mention that it is only present if not empty.
Sorry for delay, pushed correction
1367 | + " \"trusted\": xxx, (bool) Whether we consider the outputs of this unconfirmed transaction safe to spend.\n" 1368 | + " \"blockhash\": \"hashvalue\", (string) The block hash containing the transaction.\n" 1369 | + " \"blockindex\": n, (numeric) The index of the transaction in the block that includes it.\n" 1370 | + " \"blocktime\": xxx, (numeric) The block time in seconds since epoch (1 Jan 1970 GMT).\n" 1371 | + " \"txid\": \"transactionid\", (string) The transaction id.\n" 1372 | + " \"walletconflicts: \"hashvalue\", (array) List of txids that conflict with this transaction.\n"
<details><summary>Rendered diff:</summary>
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.
}
]
</details>
1358 | @@ -1359,6 +1359,27 @@ static void ListTransactions(interfaces::Chain::Lock& locked_chain, CWallet* con 1359 | } 1360 | } 1361 | 1362 | +static const std::string TransactionDescriptionString() 1363 | +{ 1364 | + return " \"confirmations\": n, (numeric) The number of confirmations for the transaction. Negative confirmations indicate the\n" 1365 | + " transaction conflicts with the block chain.\n" 1366 | + " \"generated\": xxx, (bool) Only returns true if transaction only input is a coinbase one, otherwise false.\n"
This is wrong. The field can never be false
1368 | " \"blockhash\": \"hashvalue\", (string) The block hash containing the transaction.\n" 1369 | " \"blockindex\": n, (numeric) The index of the transaction in the block that includes it.\n" 1370 | " \"blocktime\": xxx, (numeric) The block time in seconds since epoch (1 Jan 1970 GMT).\n" 1371 | " \"txid\": \"transactionid\", (string) The transaction id.\n" 1372 | + " \"walletconflicts\": [ (array) List of txids.\n" 1373 | + " \"txid\", (string) The conflicting txid.\n"
1358 | @@ -1359,6 +1359,27 @@ static void ListTransactions(interfaces::Chain::Lock& locked_chain, CWallet* con 1359 | } 1360 | } 1361 | 1362 | +static const std::string TransactionDescriptionString() 1363 | +{ 1364 | + return " \"confirmations\": n, (numeric) The number of confirmations for the transaction. Negative confirmations indicate the\n" 1365 | + " transaction conflicts with the block chain.\n" 1366 | + " \"generated\": xxx, (bool) Only returns true if transaction only input is a coinbase one, otherwise false.\n" 1367 | + " \"trusted\": xxx, (bool) Whether we consider the outputs of this unconfirmed transaction safe to spend.\n"
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.
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
Sorry for the delay, was offline for few days, updated with suggested changes at 396da1d
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.
}
]
1707 | - " }\n" 1708 | - " ,...\n" 1709 | - " ],\n" 1710 | - " \"hex\" : \"data\" (string) Raw data for transaction\n" 1711 | - " \"decoded\" : transaction (json object) Optional, the decoded transaction (only present when `verbose` is passed), equivalent to the\n" 1712 | - " RPC decoderawtransaction method, or the RPC getrawtransaction method when `verbose` is passed.\n"
Why is this removed?
Corrected
1372 | + " \"walletconflicts\": [ (array) Conflicting transaction ids.\n" 1373 | + " \"txid\", (string) The transaction id.\n" 1374 | + " ...\n" 1375 | + " ],\n" 1376 | + " \"time\": xxx, (numeric) The transaction time in seconds since epoch (midnight Jan 1 1970 GMT).\n" 1377 | + " \"timereceived\": xxx, (numeric) The time received in seconds since epoch (midnight Jan 1 1970 GMT).\n"
I'd say to remove midnight, because we don't use that nomenclature anywhere else
1358 | @@ -1359,6 +1359,27 @@ static void ListTransactions(interfaces::Chain::Lock& locked_chain, CWallet* con 1359 | } 1360 | } 1361 | 1362 | +static const std::string TransactionDescriptionString() 1363 | +{ 1364 | + return " \"confirmations\": n, (numeric) The number of confirmations for the transaction. Negative confirmations indicate the\n" 1365 | + " transaction conflicts with the block chain.\n"
I liked the previous wording, which was more accurate.
.. means the transaction conflicted that many blocks ago.
ACK 396da1d8a2ab9c2bd026eece0186b6e9d8c3181c
<details><summary>Show signature and timestamp</summary>
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 -
</details>
Fields involvesWatchonly, generated, walletconflicts were missing
in result description of listtransactions, listsinceblock,
gettransaction
Align getttransaction fields which were odd compare to other rpc
helpers
re-ACK f4c8953b0073e6bc37abd18ec4a5cbc3ea9719a1 (only change is addressing my nits)
<details><summary>Show signature and timestamp</summary>
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 -
</details>
ACK f4c8953b0073e6bc37abd18ec4a5cbc3ea9719a1