From 48605bd1b787bd1bd83755b0f8abb3b9a75a3e1c Mon Sep 17 00:00:00 2001 From: Prasanna Loganathar Date: Wed, 20 Jul 2022 14:48:21 +0530 Subject: [PATCH 1/2] Fix for testpoolswap auto selection on disabled pools --- src/masternodes/rpc_poolpair.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/masternodes/rpc_poolpair.cpp b/src/masternodes/rpc_poolpair.cpp index c883d5c1d8..3285acc93f 100644 --- a/src/masternodes/rpc_poolpair.cpp +++ b/src/masternodes/rpc_poolpair.cpp @@ -1085,7 +1085,7 @@ UniValue testpoolswap(const JSONRPCRequest& request) { int targetHeight = ::ChainActive().Height() + 1; auto poolPair = mnview_dummy.GetPoolPair(poolSwapMsg.idTokenFrom, poolSwapMsg.idTokenTo); - if (poolPair && path == "auto") path = "direct"; + if (poolPair && !poolPair->second.status && path == "auto") path = "direct"; // If no direct swap found search for composite swap if (path == "direct") { From fd16d1a759dfc00e6b6591244e8703e43085d0db Mon Sep 17 00:00:00 2001 From: Prasanna Loganathar Date: Wed, 20 Jul 2022 14:51:17 +0530 Subject: [PATCH 2/2] Update rpc_poolpair.cpp --- src/masternodes/rpc_poolpair.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/masternodes/rpc_poolpair.cpp b/src/masternodes/rpc_poolpair.cpp index 3285acc93f..e32655dce0 100644 --- a/src/masternodes/rpc_poolpair.cpp +++ b/src/masternodes/rpc_poolpair.cpp @@ -1085,7 +1085,7 @@ UniValue testpoolswap(const JSONRPCRequest& request) { int targetHeight = ::ChainActive().Height() + 1; auto poolPair = mnview_dummy.GetPoolPair(poolSwapMsg.idTokenFrom, poolSwapMsg.idTokenTo); - if (poolPair && !poolPair->second.status && path == "auto") path = "direct"; + if (poolPair && poolPair->second.status && path == "auto") path = "direct"; // If no direct swap found search for composite swap if (path == "direct") {