From c477eb48a43cfe1803369f7d5146901b85790e03 Mon Sep 17 00:00:00 2001 From: Bronek Kozicki Date: Mon, 30 Oct 2023 17:35:33 +0000 Subject: [PATCH] Improved comments --- src/ripple/protocol/STTx.h | 10 ++++++---- src/ripple/protocol/impl/STTx.cpp | 5 ++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/ripple/protocol/STTx.h b/src/ripple/protocol/STTx.h index 195f3a1de3f..505b502d07b 100644 --- a/src/ripple/protocol/STTx.h +++ b/src/ripple/protocol/STTx.h @@ -109,10 +109,12 @@ class STTx final : public STObject, public CountedObject Json::Value getJson(JsonOptions options) const override; - /// If `hash` is set, will store hash inside the provided string. Otherwise - /// hash will be stored as nested jss::hash element inside the returned JSON - /// Additionally, if `hash` is set and `binary` is true, will not create - /// nested jss::tx for binary hex; instead will return it as JSON string + /** + If `hash` is set, will store transaction id inside the provided string. + Otherwise it will be stored as nested jss::hash element inside the returned + JSON. Additionally, if `hash` is set and `binary` is true, will not create + nested jss::tx for binary hex; instead will return it as JSON string + */ Json::Value getJson( JsonOptions options, diff --git a/src/ripple/protocol/impl/STTx.cpp b/src/ripple/protocol/impl/STTx.cpp index abcd01049b0..95d859a48e9 100644 --- a/src/ripple/protocol/impl/STTx.cpp +++ b/src/ripple/protocol/impl/STTx.cpp @@ -260,7 +260,10 @@ STTx::getJson( Json::Value ret = strHex(s.peekData()); return ret; } - return STObject::getJson(JsonOptions::none); // Yes, want `none` + // We want virtualy the same output as `getJson(JsonOptions)` overload + // above, but without the hash element. Since `getJson(JsonOptions)` + // is using STObject::getJson(JsonOptions::none), we use it here as well + return STObject::getJson(JsonOptions::none); } std::string const&