aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/rpcwallet.cpp
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2021-09-29 17:50:26 +0200
committerJon Atack <jon@atack.com>2021-09-29 22:35:43 +0200
commitd95913fc432f0fde9dec743884b14c5df83727af (patch)
tree9e0faff1860ac4e9375355805868157a926db7af /src/wallet/rpcwallet.cpp
parentefa227f5df5f5a9669dec5f1d574cf22d3c0903f (diff)
rpc: fix "trusted" description in TransactionDescriptionString
The helps for RPCs gettransaction, listtransactions, and listsinceblock returned by TransactionDescriptionString() state that the "trusted" boolean field is only present if the transaction is trusted and safe to spend from. The "trusted" boolean field is in fact returned by WalletTxToJSON() when the transaction has 0 confirmations, or negative confirmations, if conflicted, and it can be true or false. This commit updates TransactionDescriptionString() to a more accurate description for "trusted" and updates the existing line of test coverage to fail more helpfully.
Diffstat (limited to 'src/wallet/rpcwallet.cpp')
-rw-r--r--src/wallet/rpcwallet.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp
index c430b1db5c..e90bd207d7 100644
--- a/src/wallet/rpcwallet.cpp
+++ b/src/wallet/rpcwallet.cpp
@@ -1389,7 +1389,8 @@ static const std::vector<RPCResult> TransactionDescriptionString()
return{{RPCResult::Type::NUM, "confirmations", "The number of confirmations for the transaction. Negative confirmations means the\n"
"transaction conflicted that many blocks ago."},
{RPCResult::Type::BOOL, "generated", /* optional */ true, "Only present if transaction only input is a coinbase one."},
- {RPCResult::Type::BOOL, "trusted", /* optional */ true, "Only present if we consider transaction to be trusted and so safe to spend from."},
+ {RPCResult::Type::BOOL, "trusted", /* optional */ true, "Whether we consider the transaction to be trusted and safe to spend from.\n"
+ "Only present when the transaction has 0 confirmations (or negative confirmations, if conflicted)."},
{RPCResult::Type::STR_HEX, "blockhash", /* optional */ true, "The block hash containing the transaction."},
{RPCResult::Type::NUM, "blockheight", /* optional */ true, "The block height containing the transaction."},
{RPCResult::Type::NUM, "blockindex", /* optional */ true, "The index of the transaction in the block that includes it."},
@@ -1407,7 +1408,7 @@ static const std::vector<RPCResult> TransactionDescriptionString()
{RPCResult::Type::NUM_TIME, "timereceived", "The time received expressed in " + UNIX_EPOCH_TIME + "."},
{RPCResult::Type::STR, "comment", /* optional */ true, "If a comment is associated with the transaction, only present if not empty."},
{RPCResult::Type::STR, "bip125-replaceable", "(\"yes|no|unknown\") Whether this transaction could be replaced due to BIP125 (replace-by-fee);\n"
- "may be unknown for unconfirmed transactions not in the mempool"}};
+ "may be unknown for unconfirmed transactions not in the mempool."}};
}
static RPCHelpMan listtransactions()