From 10be25ee8287eea02f5f0ff9ccdb308235bd143d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Nov=C3=BD?= Date: Sun, 22 Apr 2018 04:25:40 +0200 Subject: [PATCH] stratum: correctly create blocks with 253-255 transactions (#260) According to [1], varints of 0xfd to 0xff are prefixed with 0xfd too. [1]: http://learnmeabitcoin.com/glossary/varint --- stratum/client_submit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stratum/client_submit.cpp b/stratum/client_submit.cpp index 47dfd0f..78fc94c 100644 --- a/stratum/client_submit.cpp +++ b/stratum/client_submit.cpp @@ -215,7 +215,7 @@ static void client_do_submit(YAAMP_CLIENT *client, YAAMP_JOB *job, YAAMP_JOB_VAL if(hash_int <= coin_target) { char count_hex[8] = { 0 }; - if (templ->txcount <= 255) + if (templ->txcount <= 252) sprintf(count_hex, "%02x", templ->txcount & 0xFF); else sprintf(count_hex, "fd%02x%02x", templ->txcount & 0xFF, templ->txcount >> 8);