From 029c3a3134ab4ea78222697942e6e79191aba226 Mon Sep 17 00:00:00 2001 From: parazyd Date: Thu, 9 Nov 2023 14:03:33 +0100 Subject: [PATCH] mmproxy/stratum: Attempt using wide_difficulty for mining target --- bin/darkfi-mmproxy/src/stratum.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/darkfi-mmproxy/src/stratum.rs b/bin/darkfi-mmproxy/src/stratum.rs index e3976dbb5..bcdad6aca 100644 --- a/bin/darkfi-mmproxy/src/stratum.rs +++ b/bin/darkfi-mmproxy/src/stratum.rs @@ -203,8 +203,13 @@ async fn getblocktemplate(endpoint: &Url, wallet_address: &monero::Address) -> R // Modify the coinbase tx with our additional merge mining data block_template.miner_tx.prefix.extra = tx_extra; - // TODO: Get the difficulty target - let target = "b88d0600".to_string(); + // Get the difficulty target + let target = rep["result"]["wide_difficulty"] + .get::() + .unwrap() + .strip_prefix("0x") + .unwrap() + .to_string(); // Get the remaining metadata let height = *rep["result"]["height"].get::().unwrap();