message: fixed FailoverCallback::reconnectionLoop()
diff: @@ -136,11 +136,10 @@ namespace iroha {
  }
  };
  - auto check_for_data =
  - [](auto &sessionBackend_, auto *result_, auto *errMsg) {
  + auto check_for_data = [](auto &conn, auto *result, auto *errMsg) {
  std::string msg(errMsg);
  - ExecStatusType const status = PQresultStatus(result_);
  + ExecStatusType const status = PQresultStatus(result);
  switch (status) {
  case PGRES_EMPTY_QUERY:
  case PGRES_COMMAND_OK:
  @@ -153,7 +152,7 @@ namespace iroha {
  case PGRES_FATAL_ERROR:
  msg += " Fatal error.";
  - if (PQstatus(sessionBackend_.conn_) == CONNECTION_BAD) {
  + if (PQstatus(conn) == CONNECTION_BAD) {
  msg += " Connection failed.";
  }
  @@ -167,14 +166,14 @@ namespace iroha {
  break;
  }
  - const char *const pqError = PQresultErrorMessage(result_);
  + const char *const pqError = PQresultErrorMessage(result);
  if (pqError && *pqError) {
  msg += " ";
  msg += pqError;
  }
  const char *sqlstate =
  - PQresultErrorField(result_, PG_DIAG_SQLSTATE);
  + PQresultErrorField(result, PG_DIAG_SQLSTATE);
  const char *const blank_sql_state = " ";
  if (!sqlstate) {
  sqlstate = blank_sql_state;
  @@ -183,18 +182,16 @@ namespace iroha {
  throw std::runtime_error(msg);
  };
  - auto connect = [check_for_data](auto &session_backend,
  - auto &parameters,
  - auto &conn_) {
  - PGconn *conn =
  + auto connect = [check_for_data](auto &conn, auto &parameters) {
  + PGconn *new_conn =
  PQconnectdb(parameters.get_connect_string().c_str());
  - if (0 == conn || CONNECTION_OK != PQstatus(conn)) {
  + if (0 == new_conn || CONNECTION_OK != PQstatus(new_conn)) {
  std::string msg =
  "Cannot establish connection to the database.";
  - if (0 != conn) {
  + if (0 != new_conn) {
  msg += '\n';
  - msg += PQerrorMessage(conn);
  - PQfinish(conn);
  + msg += PQerrorMessage(new_conn);
  + PQfinish(new_conn);
  }
  throw std::runtime_error(msg);
  @@ -205,19 +202,19 @@ namespace iroha {
  // which is not the case with the default value of 0. Use the
  // maximal supported value, which was 2 until 9.x and is 3 since
  // it.
  - int const version = PQserverVersion(conn);
  + int const version = PQserverVersion(new_conn);
  check_for_data(
  - session_backend,
  - PQexec(conn,
  + new_conn,
  + PQexec(new_conn,
  version >= 90000 ? "SET extra_float_digits = 3"
  : "SET extra_float_digits = 2"),
  "Cannot set extra_float_digits parameter");
  - conn_ = conn;
  + conn = new_conn;
  };
  clean_up(conn_);
  - connect(*pg_connection, parameters, conn_);
  + connect(conn_, parameters);
  init_session_(connection_);
  successful_reconnection = true;
  