|
|
@ -381,21 +381,10 @@ namespace
|
|
|
|
|
|
|
|
|
|
|
|
boost::optional<std::pair<uint32_t, uint32_t>> parse_subaddress_lookahead(const std::string& str)
|
|
|
|
boost::optional<std::pair<uint32_t, uint32_t>> parse_subaddress_lookahead(const std::string& str)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
auto pos = str.find(":");
|
|
|
|
auto r = tools::parse_subaddress_lookahead(str);
|
|
|
|
bool r = pos != std::string::npos;
|
|
|
|
if (!r)
|
|
|
|
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
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
fail_msg_writer() << tr("invalid format for subaddress lookahead; must be <major>:<minor>");
|
|
|
|
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)
|
|
|
|
void handle_transfer_exception(const std::exception_ptr &e, bool trusted_daemon)
|
|
|
|