From 9120b860075af629ceb2980257e5f1d489941743 Mon Sep 17 00:00:00 2001 From: SChernykh Date: Mon, 30 Aug 2021 01:21:46 +0200 Subject: [PATCH] Fixed use of out of scope variable --- src/p2pool.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/p2pool.cpp b/src/p2pool.cpp index 5216d92..338077c 100644 --- a/src/p2pool.cpp +++ b/src/p2pool.cpp @@ -346,8 +346,12 @@ void p2pool::submit_block() const } request.append("\"]}"); + const uint32_t template_id = submit_data.template_id; + const uint32_t nonce = submit_data.nonce; + const uint32_t extra_nonce = submit_data.extra_nonce; + JSONRPCRequest::call(m_params->m_host, m_params->m_rpcPort, request.c_str(), - [height, diff, &submit_data](const char* data, size_t size) + [height, diff, template_id, nonce, extra_nonce](const char* data, size_t size) { rapidjson::Document doc; if (doc.Parse(data, size).HasParseError() || !doc.IsObject()) { @@ -370,7 +374,7 @@ void p2pool::submit_block() const error_msg = it->value.GetString(); } - LOGERR(0, "submit_block: daemon returned error: '" << (error_msg ? error_msg : "unknown error") << "', template id = " << submit_data.template_id << ", nonce = " << submit_data.nonce << ", extra_nonce = " << submit_data.extra_nonce); + LOGERR(0, "submit_block: daemon returned error: '" << (error_msg ? error_msg : "unknown error") << "', template id = " << template_id << ", nonce = " << nonce << ", extra_nonce = " << extra_nonce); return; }