From 45f7e3a31a0117709466e8b8e8af3777cd2fad27 Mon Sep 17 00:00:00 2001 From: Niven Date: Thu, 23 Nov 2023 18:00:32 +0800 Subject: [PATCH] Add td single key check config into defid (#2714) --- src/dfi/rpc_accounts.cpp | 2 +- src/init.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dfi/rpc_accounts.cpp b/src/dfi/rpc_accounts.cpp index 7d7f8d12bc..a1212383de 100644 --- a/src/dfi/rpc_accounts.cpp +++ b/src/dfi/rpc_accounts.cpp @@ -2309,7 +2309,7 @@ UniValue transferdomain(const JSONRPCRequest &request) { // dst.data.assign(dstObj["data"].getValStr().begin(), dstObj["data"].getValStr().end()); // Single key check - bool singlekeycheck = true; + auto singlekeycheck = gArgs.GetBoolArg("-tdsinglekeycheck", true); if (!singlekeycheckObj.isNull()) { singlekeycheck = singlekeycheckObj.getBool(); } diff --git a/src/init.cpp b/src/init.cpp index 9186b3121e..8300a74f3c 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -609,6 +609,7 @@ void SetupServerArgs() gArgs.AddArg("-printpriority", strprintf("Log transaction fee per kB when mining blocks (default: %u)", DEFAULT_PRINTPRIORITY), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST); gArgs.AddArg("-printtoconsole", "Send trace/debug info to console (default: 1 when no -daemon. To disable logging to file, set -nodebuglogfile)", ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST); gArgs.AddArg("-shrinkdebugfile", "Shrink debug.log file on client startup (default: 1 when no -debug)", ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST); + gArgs.AddArg("-tdsinglekeycheck", "Set the single key check flag for transferdomain RPC. If enabled, transfers between domain are only allowed if the addresses specified corresponds to the same key (default: true)", ArgsManager::ALLOW_ANY, OptionsCategory::RPC); gArgs.AddArg("-uacomment=", "Append comment to the user agent string", ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST); SetupChainParamsBaseOptions();