Skip to content

Commit

Permalink
rpc: Show time only for V1 transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
lateminer committed May 5, 2024
1 parent 508d762 commit 187f79a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core_write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int64_t>(static_cast<uint32_t>(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);
Expand Down

0 comments on commit 187f79a

Please sign in to comment.