diff options
| author | Sebastian Falbesoner <[email protected]> | 2020-07-19 17:25:07 +0200 |
|---|---|---|
| committer | Sebastian Falbesoner <[email protected]> | 2020-07-19 17:25:07 +0200 |
| commit | 55057ffc51697daafac1224664d5e3258ae0b116 (patch) | |
| tree | 6fae8fd59bfaee7ae54abeceb71cced8c46893da | |
| parent | Merge #19551: fuzz: fix unused variable compiler warning in addrdb (diff) | |
| download | discoin-55057ffc51697daafac1224664d5e3258ae0b116.tar.xz discoin-55057ffc51697daafac1224664d5e3258ae0b116.zip | |
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.cpp | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index 0bc3e0fe9..d5e902cad 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", |