diff --git a/src/util/bip32.cpp b/src/util/bip32.cpp index 4ab14bd7041..db40bfb5b9e 100644 --- a/src/util/bip32.cpp +++ b/src/util/bip32.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2019-2022 The Bitcoin Core developers +// Copyright (c) 2019-present The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -36,14 +36,11 @@ bool ParseHDKeypath(const std::string& keypath_str, std::vector& keypa } // Ensure this is only numbers - if (item.find_first_not_of( "0123456789" ) != std::string::npos) { + const auto number{ToIntegral(item)}; + if (!number) { return false; } - uint32_t number; - if (!ParseUInt32(item, &number)) { - return false; - } - path |= number; + path |= *number; keypath.push_back(path); first = false;