Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion doc/example_datum_gateway_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"migration_max_seconds": 86400,
"pool_pass_workers": true,
"pool_pass_full_users": true,
"pooled_mining_only": true
"pooled_mining_only": true,
"coinbaser_refetch": true
}
}
9 changes: 8 additions & 1 deletion src/datum_coinbaser.c
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,14 @@ void *datum_coinbaser_thread(void *ptr) {
s->available_coinbase_outputs_count = 0;
i = 0;
}
if (i>=0) {
/* Pool mode only, and only when datum.coinbaser_refetch is true
* (the default). A short list is not done: keep the current job
* and ask again. Solo, or refetch disabled, publishes the local
* one-output coinbase and stops asking. */
if (datum_config.datum_coinbaser_refetch && datum_protocol_is_active() && i < 2) {
DLOG_WARN("Coinbaser returned %d outputs (<2); not publishing one-output coinbase, will retry", i);
usleep(500000);
} else if (i>=0) {
DLOG_DEBUG("Generating coinbases for up to %d outputs", i);
generate_coinbase_txns_for_stratum_job(s, false);
if (__builtin_expect(atomic_load_explicit(&need_coinbaser_rwlocks_init_done, memory_order_acquire), 1)) {
Expand Down
3 changes: 3 additions & 0 deletions src/datum_conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ const T_DATUM_CONFIG_ITEM datum_config_options[] = {
{ .var_type = DATUM_CONF_BOOL, .category = "datum", .name = "pooled_mining_only", .description = "If the DATUM pool server becomes unavailable, terminate miner connections (otherwise, 100% of any blocks you find pay mining.pool_address)",
.example_default = true,
.required = false, .ptr = &datum_config.datum_pooled_mining_only, .default_bool = true },
{ .var_type = DATUM_CONF_BOOL, .category = "datum", .name = "coinbaser_refetch", .description = "While connected to a DATUM pool, if a coinbaser answer has fewer than 2 outputs, keep the current job and ask again. Set false to publish the one-output coinbase and stop asking until the next job. Ignored when the pool link is down.",
.example_default = true,
.required = false, .ptr = &datum_config.datum_coinbaser_refetch, .default_bool = true },
{ .var_type = DATUM_CONF_INT, .category = "datum", .name = "protocol_global_timeout", .description = "If no valid messages are received from the DATUM server in this many seconds, give up and try to reconnect",
.required = false, .ptr = &datum_config.datum_protocol_global_timeout, .default_int = 60 },
};
Expand Down
1 change: 1 addition & 0 deletions src/datum_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ typedef struct {
bool datum_pool_pass_workers;
bool datum_pool_pass_full_users;
bool datum_pooled_mining_only;
bool datum_coinbaser_refetch;
char datum_pool_pubkey[1024];
int datum_protocol_global_timeout;
uint64_t datum_protocol_global_timeout_ms;
Expand Down
Loading