From 0035a7e2c887d5077b2f82b097895c0fa8ee0c53 Mon Sep 17 00:00:00 2001 From: Prasanna Loganathar Date: Mon, 27 Dec 2021 20:36:39 +0530 Subject: [PATCH] Fix excess logging of composite swap (#1003) --- src/masternodes/mn_checks.cpp | 2 +- src/masternodes/mn_checks.h | 2 +- src/masternodes/rpc_poolpair.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/masternodes/mn_checks.cpp b/src/masternodes/mn_checks.cpp index 11f3d9fcc0..d691f43cc2 100644 --- a/src/masternodes/mn_checks.cpp +++ b/src/masternodes/mn_checks.cpp @@ -3556,7 +3556,7 @@ Res CPoolSwap::ExecuteSwap(CCustomCSView& view, std::vector poolIDs) { } intermediateView.Flush(); - return Res::Ok(swapAmountResult.ToString()); + return res; }, static_cast(height)); if (!poolResult) { diff --git a/src/masternodes/mn_checks.h b/src/masternodes/mn_checks.h index 05dd19d09f..e2c83af087 100644 --- a/src/masternodes/mn_checks.h +++ b/src/masternodes/mn_checks.h @@ -485,7 +485,7 @@ class CPoolSwap { std::vector CalculateSwaps(CCustomCSView& view); Res ExecuteSwap(CCustomCSView& view, std::vector poolIDs); std::vector> CalculatePoolPaths(CCustomCSView& view); - + CTokenAmount GetResult() { return CTokenAmount{obj.idTokenTo, result}; }; }; #endif // DEFI_MASTERNODES_MN_CHECKS_H diff --git a/src/masternodes/rpc_poolpair.cpp b/src/masternodes/rpc_poolpair.cpp index 51287a57db..f91bb46772 100644 --- a/src/masternodes/rpc_poolpair.cpp +++ b/src/masternodes/rpc_poolpair.cpp @@ -1081,10 +1081,10 @@ UniValue testpoolswap(const JSONRPCRequest& request) { } throw JSONRPCError(RPC_INVALID_REQUEST, errorMsg); } - for (const auto& id : poolIds) { pools.push_back(id.ToString()); } + res.msg = compositeSwap.GetResult().ToString(); } } if (verbose) {