aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Falbesoner <sebastian.falbesoner@gmail.com>2020-07-19 17:25:07 +0200
committerSebastian Falbesoner <sebastian.falbesoner@gmail.com>2020-07-19 17:25:07 +0200
commit55057ffc51697daafac1224664d5e3258ae0b116 (patch)
tree6fae8fd59bfaee7ae54abeceb71cced8c46893da
parent476436b2dec254bb988f8c7a6cbec1d7bb7cecfd (diff)
rpc: deduplicate WriteHDKeypath() used in decodepsbt
The functionality is already provided in the BIP32 utility library util/bip32.h with the exact same name and function signature.
-rw-r--r--src/rpc/rawtransaction.cpp20
1 files changed, 1 insertions, 19 deletions
diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp
index 0bc3e0fe9f..d5e902cadd 100644
--- a/src/rpc/rawtransaction.cpp
+++ b/src/rpc/rawtransaction.cpp
@@ -28,6 +28,7 @@
#include <script/signingprovider.h>
#include <script/standard.h>
#include <uint256.h>
+#include <util/bip32.h>
#include <util/moneystr.h>
#include <util/strencodings.h>
#include <util/string.h>
@@ -938,25 +939,6 @@ static UniValue testmempoolaccept(const JSONRPCRequest& request)
return result;
}
-static std::string WriteHDKeypath(std::vector<uint32_t>& keypath)
-{
- std::string keypath_str = "m";
- for (uint32_t num : keypath) {
- keypath_str += "/";
- bool hardened = false;
- if (num & 0x80000000) {
- hardened = true;
- num &= ~0x80000000;
- }
-
- keypath_str += ToString(num);
- if (hardened) {
- keypath_str += "'";
- }
- }
- return keypath_str;
-}
-
UniValue decodepsbt(const JSONRPCRequest& request)
{
RPCHelpMan{"decodepsbt",