aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/rpc/transactions.cpp
diff options
context:
space:
mode:
authorishaanam <ishaana.misra@gmail.com>2023-07-16 21:42:33 -0400
committerishaanam <ishaana.misra@gmail.com>2024-03-20 15:05:37 -0400
commit5952292133d6cc889f51ae771f2e0557311e1efe (patch)
tree9205b27d3ba82a4a9cd4e7eeb5f09b211e5cc575 /src/wallet/rpc/transactions.cpp
parent54e07ee22ff16fc68583ade0d2b8ffffc81d444a (diff)
downloadbitcoin-5952292133d6cc889f51ae771f2e0557311e1efe.tar.xz
wallet, rpc: show mempool conflicts in `gettransaction` result
Diffstat (limited to 'src/wallet/rpc/transactions.cpp')
-rw-r--r--src/wallet/rpc/transactions.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/wallet/rpc/transactions.cpp b/src/wallet/rpc/transactions.cpp
index e6c021d426..05b340995d 100644
--- a/src/wallet/rpc/transactions.cpp
+++ b/src/wallet/rpc/transactions.cpp
@@ -40,6 +40,10 @@ static void WalletTxToJSON(const CWallet& wallet, const CWalletTx& wtx, UniValue
for (const uint256& conflict : wallet.GetTxConflicts(wtx))
conflicts.push_back(conflict.GetHex());
entry.pushKV("walletconflicts", conflicts);
+ UniValue mempool_conflicts(UniValue::VARR);
+ for (const Txid& mempool_conflict : wtx.mempool_conflicts)
+ mempool_conflicts.push_back(mempool_conflict.GetHex());
+ entry.pushKV("mempoolconflicts", mempool_conflicts);
entry.pushKV("time", wtx.GetTxTime());
entry.pushKV("timereceived", int64_t{wtx.nTimeReceived});
@@ -417,6 +421,10 @@ static std::vector<RPCResult> TransactionDescriptionString()
}},
{RPCResult::Type::STR_HEX, "replaced_by_txid", /*optional=*/true, "Only if 'category' is 'send'. The txid if this tx was replaced."},
{RPCResult::Type::STR_HEX, "replaces_txid", /*optional=*/true, "Only if 'category' is 'send'. The txid if this tx replaces another."},
+ {RPCResult::Type::ARR, "mempoolconflicts", "Transactions that directly conflict with either this transaction or an ancestor transaction",
+ {
+ {RPCResult::Type::STR_HEX, "txid", "The transaction id."},
+ }},
{RPCResult::Type::STR, "to", /*optional=*/true, "If a comment to is associated with the transaction."},
{RPCResult::Type::NUM_TIME, "time", "The transaction time expressed in " + UNIX_EPOCH_TIME + "."},
{RPCResult::Type::NUM_TIME, "timereceived", "The time received expressed in " + UNIX_EPOCH_TIME + "."},