From e8ccc78132e5333778a3ca816ce827c97f37772c Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Tue, 7 Jun 2022 10:03:05 -0500 Subject: [PATCH] Add tx version --- src/wallet/rpcwallet.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 76989c642..1090d270d 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -1708,6 +1708,7 @@ UniValue gettransaction(const UniValue& params, bool fHelp) "\nResult:\n" "{\n" " \"status\" : \"mined|waiting|expiringsoon|expired\", (string) The transaction status, can be 'mined', 'waiting', 'expiringsoon' or 'expired'\n" + " \"version\" : \"x\", (string) The transaction version\n" " \"amount\" : x.xxx, (numeric) The transaction amount in " + CURRENCY_UNIT + "\n" " \"amountZat\" : x (numeric) The amount in " + MINOR_CURRENCY_UNIT + "\n" " \"confirmations\" : n, (numeric) The number of confirmations\n" @@ -1767,6 +1768,7 @@ UniValue gettransaction(const UniValue& params, bool fHelp) CAmount nNet = nCredit - nDebit; CAmount nFee = (wtx.IsFromMe(filter) ? wtx.GetValueOut() - nDebit : 0); + entry.pushKV("version", wtx.nVersion); entry.pushKV("amount", ValueFromAmount(nNet - nFee)); entry.pushKV("amountZat", nNet - nFee); if (wtx.IsFromMe(filter))