diff options
| author | fanquake <[email protected]> | 2020-07-21 08:32:45 +0800 |
|---|---|---|
| committer | fanquake <[email protected]> | 2020-07-21 09:11:48 +0800 |
| commit | f5000ae66c4042514f6404ee957fce8f5820600e (patch) | |
| tree | 6fae8fd59bfaee7ae54abeceb71cced8c46893da /src | |
| parent | Merge #19551: fuzz: fix unused variable compiler warning in addrdb (diff) | |
| parent | rpc: deduplicate WriteHDKeypath() used in decodepsbt (diff) | |
| download | discoin-f5000ae66c4042514f6404ee957fce8f5820600e.tar.xz discoin-f5000ae66c4042514f6404ee957fce8f5820600e.zip | |
Merge #19555: rpc: deduplicate WriteHDKeypath() used in decodepsbt
55057ffc51697daafac1224664d5e3258ae0b116 rpc: deduplicate WriteHDKeypath() used in decodepsbt (Sebastian Falbesoner)
Pull request description:
The functionality is already provided in the BIP32 utility library `util/bip32.h` with the exact same name and function signature.
ACKs for top commit:
achow101:
ACK 55057ffc51697daafac1224664d5e3258ae0b116
instagibbs:
utACK https://github.com/bitcoin/bitcoin/pull/19555/commits/55057ffc51697daafac1224664d5e3258ae0b116
jonatack:
ACK 55057ffc51697daafac1224664d5e3258ae0b116
Tree-SHA512: 074c1a71ffb32908926bf07f0c5428a46309f6e0d21e7c20b1008197c820b97776a441736d0b6fd8ab0c0852522a0b5a5ddb26a1e4a1100ca02aabc65a07a018
Diffstat (limited to 'src')
| -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", |