From efce66aa9df54bd47d5e11c2910037ad32d7515e Mon Sep 17 00:00:00 2001 From: levonpetrosyan93 <45027856+levonpetrosyan93@users.noreply.github.com> Date: Thu, 21 Dec 2023 12:15:46 +0400 Subject: [PATCH] Dump spark secret key (#1377) --- src/wallet/rpcdump.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp index 4350896f98..9fac69a95a 100644 --- a/src/wallet/rpcdump.cpp +++ b/src/wallet/rpcdump.cpp @@ -804,6 +804,19 @@ UniValue dumpwallet(const JSONRPCRequest& request) } } + if (pwallet->sparkWallet) { + file << "\n"; + CKey key; + uint32_t nCount; + { + LOCK(pwalletMain->cs_wallet); + nCount = GetArg("-sparkncount", 1); + pwalletMain->GetKeyFromKeypath(BIP44_SPARK_INDEX, nCount, key); + } + + file << strprintf("# Spark key secret %s\n", CBitcoinSecret(key).ToString()); + } + file << "\n"; file << "# End of dump\n"; file.close();