mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 18:53:23 -03:00
Merge #19555: rpc: deduplicate WriteHDKeypath() used in decodepsbt
55057ffc51
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: ACK55057ffc51
instagibbs: utACK55057ffc51
jonatack: ACK55057ffc51
Tree-SHA512: 074c1a71ffb32908926bf07f0c5428a46309f6e0d21e7c20b1008197c820b97776a441736d0b6fd8ab0c0852522a0b5a5ddb26a1e4a1100ca02aabc65a07a018
This commit is contained in:
commit
f5000ae66c
1 changed files with 1 additions and 19 deletions
|
@ -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",
|
||||
|
|
Loading…
Add table
Reference in a new issue