@@ -135,15 +135,15 @@ void mqttReconnect()
135
135
namespace
136
136
{
137
137
// Change the part in brackets to your Duino-Coin username
138
- const char *DUCO_USER = " USERNAME " ;
138
+ const char *DUCO_USER = " mlesniew " ;
139
139
// Change the part in brackets to your mining key (if you have enabled it in the wallet)
140
- const char *MINER_KEY = " MINING_KEY " ;
140
+ const char *MINER_KEY = " turkawka " ;
141
141
// Change the part in brackets to your WiFi name
142
- const char *SSID = " WIFI_NAME " ;
142
+ const char *SSID = " CyfrowyTapczan " ;
143
143
// Change the part in brackets to your WiFi password
144
- const char *PASSWORD = " WIFI_PASSWORD " ;
144
+ const char *PASSWORD = " bohdanowicza19 " ;
145
145
// Change the part in brackets if you want to set a custom miner name (use Auto to autogenerate, None for no name)
146
- const char *RIG_IDENTIFIER = " None " ;
146
+ const char *RIG_IDENTIFIER = " Auto " ;
147
147
// Set to true to use the 160 MHz overclock mode (and not get the first share rejected)
148
148
const bool USE_HIGHER_DIFF = true ;
149
149
// Set to true if you want to host the dashboard page (available on ESPs IP address)
@@ -440,7 +440,7 @@ public:
440
440
}
441
441
442
442
Counter & operator ++() {
443
- inc_string (max_digits - 1 );
443
+ inc_string (buffer + max_digits - 1 );
444
444
++val;
445
445
return *this ;
446
446
}
@@ -450,18 +450,18 @@ public:
450
450
size_t strlen () const { return len; }
451
451
452
452
protected:
453
- inline void inc_string (int pos) {
454
- if (pos < 0 )
455
- return ;
456
-
457
- if (buffer[pos] < ' 9' ) {
458
- buffer[pos]++;
453
+ inline void inc_string (char * c) {
454
+ // In theory, the line below should be uncommented to avoid writing outside the buffer. In practice however,
455
+ // with max_digits set to 10 or more, we can fit all possible unsigned 32-bit integers in the buffer. The
456
+ // check is skipped to gain a small extra speed improvement.
457
+ // if (c >= buffer) return;
458
+ if (*c < ' 9' ) {
459
+ *c += 1 ;
459
460
} else {
460
- buffer[pos] = ' 0' ;
461
- inc_string (pos - 1 );
461
+ *c = ' 0' ;
462
+ inc_string (c - 1 );
463
+ len = max (max_digits - (c - buffer) + 1 , len);
462
464
}
463
-
464
- len = max (max_digits - pos, len);
465
465
}
466
466
467
467
protected:
@@ -777,7 +777,7 @@ void loop() {
777
777
778
778
String result = " " ;
779
779
if (LED_BLINKING) digitalWrite (LED_BUILTIN, LOW);
780
- for (Counter<8 > counter; counter < difficulty; ++counter) {
780
+ for (Counter<10 > counter; counter < difficulty; ++counter) {
781
781
// Difficulty loop
782
782
sha1_ctx = sha1_ctx_base;
783
783
0 commit comments