e7652d3f64
Creates new files util/bip32.h and util/bip32.cpp for containing BIP 32 stuff. Moves FormatKeyPath from descriptor.cpp to util/bip32. Adds a wrapper around it to prepent the 'm' for when just the BIP 32 style keypath is needed.
19 lines
652 B
C++
19 lines
652 B
C++
// Copyright (c) 2019 The Bitcoin Core developers
|
|
// Distributed under the MIT software license, see the accompanying
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
#ifndef BITCOIN_UTIL_BIP32_H
|
|
#define BITCOIN_UTIL_BIP32_H
|
|
|
|
#include <attributes.h>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
/** Parse an HD keypaths like "m/7/0'/2000". */
|
|
NODISCARD bool ParseHDKeypath(const std::string& keypath_str, std::vector<uint32_t>& keypath);
|
|
|
|
/** Write HD keypaths as strings */
|
|
std::string WriteHDKeypath(const std::vector<uint32_t>& keypath);
|
|
std::string FormatHDKeypath(const std::vector<uint32_t>& path);
|
|
|
|
#endif // BITCOIN_UTIL_BIP32_H
|