From 187f79a74a802a2adb805aa29e6e90c3bca360d2 Mon Sep 17 00:00:00 2001 From: lateminer <9951982+lateminer@users.noreply.github.com> Date: Sun, 5 May 2024 02:49:59 +0200 Subject: [PATCH] rpc: Show time only for V1 transactions --- src/core_write.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_write.cpp b/src/core_write.cpp index 0ee199fc73..2ef0bf1462 100644 --- a/src/core_write.cpp +++ b/src/core_write.cpp @@ -177,7 +177,7 @@ void TxToUniv(const CTransaction& tx, const uint256& block_hash, UniValue& entry // Transaction version is actually unsigned in consensus checks, just signed in memory, // so cast to unsigned before giving it to the user. entry.pushKV("version", static_cast(static_cast(tx.nVersion))); - if (tx.nTime > 0) + if (tx.nVersion < 2) entry.pushKV("time", (int64_t)tx.nTime); entry.pushKV("size", (int)::GetSerializeSize(tx, PROTOCOL_VERSION)); entry.pushKV("vsize", (GetTransactionWeight(tx) + WITNESS_SCALE_FACTOR - 1) / WITNESS_SCALE_FACTOR);