From 4aae9fbc2b4efc3dd76856effde6906ae631591a Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Sun, 9 Jul 2023 19:30:51 +0200 Subject: [PATCH] Fix mining submit code Use c_str(), since sprintf expects a C-string here --- src/stratum.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/stratum.cpp b/src/stratum.cpp index 3d04489..dacaaaf 100644 --- a/src/stratum.cpp +++ b/src/stratum.cpp @@ -204,11 +204,10 @@ bool tx_mining_submit(WiFiClient& client, mining_subscribe mWorker, mining_job m sprintf(payload, "{\"id\": %u, \"method\": \"mining.submit\", \"params\": [\"%s\",\"%s\",\"%s\",\"%s\",\"%s\"]}\n", id, mWorker.wName,//"bc1qvv469gmw4zz6qa4u4dsezvrlmqcqszwyfzhgwj", //mWorker.name, - mJob.job_id, - mWorker.extranonce2, - mJob.ntime, - String(nonce, HEX), - id + mJob.job_id.c_str(), + mWorker.extranonce2.c_str(), + mJob.ntime.c_str(), + String(nonce, HEX).c_str() ); Serial.print(" Sending : "); Serial.print(payload); client.print(payload);