This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
#include "cpuminer-config.h"
|
||||
#include "version.h"
|
||||
#include "miner.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include "yespower-1.0.1/yespower.h"
|
||||
#include "yespower-1.0.1/sysendian.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#ifdef TARGET_RASPBERRY_PI
|
||||
#ifdef TARGET_RASPBERRY
|
||||
#define BLOCK_VERSION BLOCK_VERSION_RASPBERRY
|
||||
#elif defined(TARGET_NOARM)
|
||||
#define BLOCK_VERSION BLOCK_VERSION_NOARM
|
||||
@@ -72,6 +72,9 @@ int scanhash_arm_yespower(int thr_id, uint32_t *pdata, const uint32_t *ptarget,
|
||||
const uint32_t Htarg = ptarget[7]; // Zielwert (kleiner ist besser)
|
||||
int i;
|
||||
|
||||
// Debug-Ausgabe: Parameter
|
||||
printf("Debug: Using Yespower parameters - N: %d, r: %d, pers: %s\n", params->N, params->r, params->pers);
|
||||
|
||||
// Blockdaten in Big-Endian formatieren
|
||||
for (i = 0; i < 20; i++) {
|
||||
be32enc(&data.u32[i], pdata[i]);
|
||||
@@ -84,12 +87,20 @@ int scanhash_arm_yespower(int thr_id, uint32_t *pdata, const uint32_t *ptarget,
|
||||
abort(); // Fehlerbehandlung
|
||||
}
|
||||
|
||||
// Debug-Ausgabe: Nonce und Hash
|
||||
printf("Debug: Nonce: %u, Hash: %08x%08x%08x%08x%08x%08x%08x%08x\n",
|
||||
n,
|
||||
hash.u32[0], hash.u32[1], hash.u32[2], hash.u32[3],
|
||||
hash.u32[4], hash.u32[5], hash.u32[6], hash.u32[7]);
|
||||
|
||||
// Überprüfung des Hash-Werts
|
||||
if (le32dec(&hash.u32[7]) <= Htarg) {
|
||||
for (i = 0; i < 8; i++) {
|
||||
hash.u32[i] = le32dec(&hash.u32[i]); // Konvertiere zu Little-Endian
|
||||
}
|
||||
if (fulltest(hash.u32, ptarget)) {
|
||||
// Debug-Ausgabe: Erfolg
|
||||
printf("Debug: Valid block found! Nonce: %u\n", n);
|
||||
*hashes_done = n - pdata[19] + 1;
|
||||
pdata[19] = n;
|
||||
return 1; // Gültiger Block gefunden
|
||||
@@ -97,7 +108,10 @@ int scanhash_arm_yespower(int thr_id, uint32_t *pdata, const uint32_t *ptarget,
|
||||
}
|
||||
} while (n < max_nonce && !work_restart[thr_id].restart);
|
||||
|
||||
// Debug-Ausgabe: Kein Block gefunden
|
||||
printf("Debug: No valid block found. Last Nonce: %u\n", n);
|
||||
|
||||
*hashes_done = n - pdata[19] + 1;
|
||||
pdata[19] = n;
|
||||
return 0; // Kein gültiger Block gefunden
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user