diff options
author | luigi1111 <luigi1111w@gmail.com> | 2018-06-25 14:49:30 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2018-06-25 14:49:30 -0500 |
commit | 473d984d88294fe6820c52094d96a0abcb8e9a90 (patch) | |
tree | 69ac017b982c55d8ce4e2b2005320eb77deb79e4 /src/simplewallet/simplewallet.cpp | |
parent | Merge pull request #3677 (diff) | |
parent | Wallet API: add support for wallet creation from hardware device (diff) | |
download | monero-473d984d88294fe6820c52094d96a0abcb8e9a90.tar.xz |
Merge pull request #3921
8fc0cdb wallet2: lower default for subaddress lookahead when restoring with hardware (stoffu)
248310d Move parse_subaddress_lookahead() from simplewallet.cpp to util.cpp (stoffu)
46e90b7 Wallet API: add support for wallet creation from hardware device (stoffu)
Diffstat (limited to 'src/simplewallet/simplewallet.cpp')
-rw-r--r-- | src/simplewallet/simplewallet.cpp | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index d0c35dfff..d531c2da2 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -379,21 +379,10 @@ namespace boost::optional<std::pair<uint32_t, uint32_t>> parse_subaddress_lookahead(const std::string& str) { - auto pos = str.find(":"); - bool r = pos != std::string::npos; - uint32_t major; - r = r && epee::string_tools::get_xtype_from_string(major, str.substr(0, pos)); - uint32_t minor; - r = r && epee::string_tools::get_xtype_from_string(minor, str.substr(pos + 1)); - if (r) - { - return std::make_pair(major, minor); - } - else - { + auto r = tools::parse_subaddress_lookahead(str); + if (!r) fail_msg_writer() << tr("invalid format for subaddress lookahead; must be <major>:<minor>"); - return {}; - } + return r; } void handle_transfer_exception(const std::exception_ptr &e, bool trusted_daemon) |