From d8b019401f3ebcb8eac35378377aae0534879df9 Mon Sep 17 00:00:00 2001 From: Dobromir Popov Date: Tue, 23 Sep 2025 11:39:03 +0300 Subject: [PATCH] stratum wip - valid block info --- MINE/rin/stratum_proxy.py | 199 +++++++++++++++++++++++++++++++++----- 1 file changed, 177 insertions(+), 22 deletions(-) diff --git a/MINE/rin/stratum_proxy.py b/MINE/rin/stratum_proxy.py index e775691..95aeef9 100644 --- a/MINE/rin/stratum_proxy.py +++ b/MINE/rin/stratum_proxy.py @@ -613,28 +613,97 @@ class RinCoinStratumProxy: print(f"[{addr}] Message handling error: {e}") def send_job_to_client(self, client, job): - """Send mining job to specific client""" + """Send mining job to specific client with proper stratum parameters""" try: - # Build coinbase components for stratum + # Get network difficulty for display + network_difficulty = self.calculate_network_difficulty(job['target']) + + # Build proper coinbase transaction parts for stratum protocol + template = job.get('template', {}) height = job.get('height', 0) - height_bytes = struct.pack(' 1 and height_bytes[-1] == 0: + height_bytes = height_bytes[:-1] + height_push = bytes([len(height_bytes)]) + height_bytes + + # Build coinbase input script: height + arbitrary data + extranonces + coinb1_script = height_push + b'/RinCoin/' + + # Build coinbase transaction structure + # Version (4 bytes) + coinb1 = struct.pack('