blocktemplates: Ensure height logging is portable

This commit is contained in:
Luke Dashjr 2025-03-08 05:37:48 +00:00
parent 676f898898
commit 18f68b2167
No known key found for this signature in database
GPG Key ID: A291A2C45D0C504A

View File

@ -436,7 +436,7 @@ void *datum_gateway_template_thread(void *args) {
t = datum_gbt_parser(res_val);
if (t) {
DLOG_DEBUG("height: %d / value: %"PRIu64,t->height, t->coinbasevalue);
DLOG_DEBUG("height: %lu / value: %"PRIu64, (unsigned long)t->height, t->coinbasevalue);
DLOG_DEBUG("--- prevhash: %s", t->previousblockhash);
DLOG_DEBUG("--- txn_count: %u / sigops: %u / weight: %u / size: %u", t->txn_count, t->txn_total_sigops, t->txn_total_weight, t->txn_total_size);
@ -446,7 +446,7 @@ void *datum_gateway_template_thread(void *args) {
update_stratum_job(t,true,JOB_STATE_EMPTY_PLUS);
strcpy(p1, t->previousblockhash);
was_notified = false;
DLOG_INFO("NEW NETWORK BLOCK: %s (%d)",t->previousblockhash,t->height);
DLOG_INFO("NEW NETWORK BLOCK: %s (%lu)", t->previousblockhash, (unsigned long)t->height);
// sleep for a milisecond
// this will let other threads churn for a moment. we wont get all the empty jobs blasted out in a milisecond anyway
@ -485,7 +485,7 @@ void *datum_gateway_template_thread(void *args) {
if (!was_notified) {
DLOG_DEBUG("Multi notified for block we knew details about. (%s)", new_notify_blockhash);
} else {
DLOG_DEBUG("Notified, however new = %s, t->previousblockhash = %s, t->height = %d, new_notify_height = %d", new_notify_blockhash, t->previousblockhash, t->height, new_notify_height);
DLOG_DEBUG("Notified, however new = %s, t->previousblockhash = %s, t->height = %lu, new_notify_height = %d", new_notify_blockhash, t->previousblockhash, (unsigned long)t->height, new_notify_height);
// Sometimes we call GBT before we get the signal from a blocknotify. It's a bit of a race condition.
// Instead of freaking out, we'll just ignore things when we get a signal that results in the same block if it was