Fix mining submit code

Use c_str(), since sprintf expects a C-string here
This commit is contained in:
Stefan Berger 2023-07-09 19:30:51 +02:00
parent 0508c1fc6b
commit 4aae9fbc2b

View File

@ -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", sprintf(payload, "{\"id\": %u, \"method\": \"mining.submit\", \"params\": [\"%s\",\"%s\",\"%s\",\"%s\",\"%s\"]}\n",
id, id,
mWorker.wName,//"bc1qvv469gmw4zz6qa4u4dsezvrlmqcqszwyfzhgwj", //mWorker.name, mWorker.wName,//"bc1qvv469gmw4zz6qa4u4dsezvrlmqcqszwyfzhgwj", //mWorker.name,
mJob.job_id, mJob.job_id.c_str(),
mWorker.extranonce2, mWorker.extranonce2.c_str(),
mJob.ntime, mJob.ntime.c_str(),
String(nonce, HEX), String(nonce, HEX).c_str()
id
); );
Serial.print(" Sending : "); Serial.print(payload); Serial.print(" Sending : "); Serial.print(payload);
client.print(payload); client.print(payload);