Verified Commit 15ca10ee authored by Tommaso Tocci's avatar Tommaso Tocci
Browse files

avoid "static initialization order problem"

ensure rpc_addresses object have been initialized before we use it for
the first time
parent 716f7705
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -265,6 +265,8 @@ void init_ld_environment_() {
        CTX->log()->error("{}() Unable to read system hostfile /etc/hosts for address mapping.", __func__);
        exit(EXIT_FAILURE);
    }
    //use rpc_addresses here to avoid "static initialization order problem"
    rpc_addresses.clear();
    if (!lookup_all_hosts()) {
        CTX->log()->error("{}() Unable to lookup all host RPC addresses.", __func__);
        exit(EXIT_FAILURE);