bootstrap_daemon: resolve CID 203915 (UNCAUGHT_EXCEPT)
The issue is triggered by the captured `this` in RPC server, which passes reference to throwable `core_rpc_server`: `core_rpc_server.cpp:164: m_bootstrap_daemon.reset(new bootstrap_daemon([this]{ return get_random_public_node(); }));` The solution is to simply remove noexcept from the remaining `bootstrap_daemon` constructors because noexcept is false in this context. >"An exception of type "boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::asio::invalid_service_owner>>" is thrown but the throw list "noexcept" doesn't allow it to be thrown. This will cause a call to unexpected() which usually calls terminate()."
This commit is contained in:
parent
2825f07d95
commit
d099658522
|
@ -12,7 +12,7 @@
|
||||||
namespace cryptonote
|
namespace cryptonote
|
||||||
{
|
{
|
||||||
|
|
||||||
bootstrap_daemon::bootstrap_daemon(std::function<boost::optional<std::string>()> get_next_public_node) noexcept
|
bootstrap_daemon::bootstrap_daemon(std::function<boost::optional<std::string>()> get_next_public_node)
|
||||||
: m_get_next_public_node(get_next_public_node)
|
: m_get_next_public_node(get_next_public_node)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ namespace cryptonote
|
||||||
class bootstrap_daemon
|
class bootstrap_daemon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
bootstrap_daemon(std::function<boost::optional<std::string>()> get_next_public_node) noexcept;
|
bootstrap_daemon(std::function<boost::optional<std::string>()> get_next_public_node);
|
||||||
bootstrap_daemon(const std::string &address, const boost::optional<epee::net_utils::http::login> &credentials);
|
bootstrap_daemon(const std::string &address, const boost::optional<epee::net_utils::http::login> &credentials);
|
||||||
|
|
||||||
std::string address() const noexcept;
|
std::string address() const noexcept;
|
||||||
|
|
Loading…
Reference in New Issue