diff --git a/MINE/rin/mining_log.txt b/MINE/rin/mining_log.txt index 68e4b6d..bf927ec 100644 --- a/MINE/rin/mining_log.txt +++ b/MINE/rin/mining_log.txt @@ -1,10 +1,10 @@ ================================================================================ RinCoin Mining Log ================================================================================ -Started: 2025-09-23 13:26:20 +Started: 2025-09-23 13:41:11 Target Address: rin1qahvvv9d5f3443wtckeqavwp9950wacxfmwv20q Stratum: 0.0.0.0:3334 RPC: 127.0.0.1:9556 ================================================================================ -[2025-09-23 13:26:20] ๐Ÿ’ฐ Wallet Balance: 25.00000000 RIN +[2025-09-23 13:41:11] ๐Ÿ’ฐ Wallet Balance: 25.00000000 RIN diff --git a/MINE/rin/stratum_proxy.py b/MINE/rin/stratum_proxy.py index 8635169..28d2fad 100644 --- a/MINE/rin/stratum_proxy.py +++ b/MINE/rin/stratum_proxy.py @@ -420,7 +420,7 @@ class RinCoinStratumProxy: optimal_difficulty = (estimated_hashrate * target_shares_per_second) / (max_target / (2**32)) # Ensure it's not too low or too high - optimal_difficulty = max(0.000001, min(optimal_difficulty, network_diff * 0.01)) + optimal_difficulty = max(0.0000001, min(optimal_difficulty, network_diff * 0.01)) print(f" ๐Ÿ“Š New client {addr}: Network diff {network_diff:.6f}, starting with {optimal_difficulty:.6f}") return optimal_difficulty @@ -455,9 +455,9 @@ class RinCoinStratumProxy: elif difficulty_multiplier < (1.0 / max_change): new_difficulty = current_difficulty / max_change - # Bounds checking for solo mining - min_difficulty = 0.0000001 # Very low minimum - max_difficulty = 0.001 # Maximum 0.1% of typical network diff + # Bounds checking for solo mining + min_difficulty = 0.00000001 # Extremely low minimum for CPU mining + max_difficulty = 0.0001 # Maximum 0.01% of typical network diff new_difficulty = max(min_difficulty, min(max_difficulty, new_difficulty)) print(f" ๐Ÿ“Š {addr}: {share_count} shares in {mining_duration:.0f}s ({actual_share_rate:.4f}/s), adjusting {current_difficulty:.6f} โ†’ {new_difficulty:.6f}") @@ -544,16 +544,20 @@ class RinCoinStratumProxy: meets_stratum_target = hash_int <= stratum_target_int meets_network_target = hash_int <= network_target_int + + # CRITICAL FIX: Check if share difficulty meets minimum requirements + meets_stratum_difficulty = share_difficulty >= client_stratum_diff + meets_network_difficulty = share_difficulty >= network_difficulty # Enhanced logging timestamp = time.strftime("%Y-%m-%d %H:%M:%S") network_percentage = (share_difficulty / network_difficulty) * 100 if network_difficulty > 0 else 0 stratum_percentage = (share_difficulty / client_stratum_diff) * 100 if client_stratum_diff > 0 else 0 - # Progress indicator based on network percentage - if meets_network_target: + # Progress indicator based on difficulty comparison + if meets_network_difficulty: progress_icon = "๐ŸŽ‰" # Block found! - elif meets_stratum_target: + elif meets_stratum_difficulty: progress_icon = "โœ…" # Valid share for stratum elif network_percentage >= 50: progress_icon = "๐Ÿ”ฅ" # Very close to network @@ -569,8 +573,8 @@ class RinCoinStratumProxy: print(f" ๐Ÿ“ˆ Progress: {network_percentage:.4f}% of network, {stratum_percentage:.1f}% of stratum") print(f" ๐Ÿ“ Target: {job['target'][:16]}... | Height: {job['height']}") print(f" โฐ Time: {ntime} | Extranonce: {extranonce1}:{extranonce2}") - print(f" ๐Ÿ” Hash vs Network: {hash_int} {'<=' if meets_network_target else '>'} {network_target_int}") - print(f" ๐Ÿ” Hash vs Stratum: {hash_int} {'<=' if meets_stratum_target else '>'} {stratum_target_int}") + print(f" ๐Ÿ” Difficulty Check: Share {share_difficulty:.2e} vs Stratum {client_stratum_diff:.6f} = {'โœ…' if meets_stratum_difficulty else 'โŒ'}") + print(f" ๐Ÿ” Difficulty Check: Share {share_difficulty:.2e} vs Network {network_difficulty:.6f} = {'โœ…' if meets_network_difficulty else 'โŒ'}") # Handle submit_all_blocks mode - bypass all difficulty checks if self.submit_all_blocks: @@ -582,13 +586,13 @@ class RinCoinStratumProxy: # Always submit in test mode should_submit = True else: - # Normal mode - check stratum difficulty - if not meets_stratum_target: - # Share doesn't meet stratum target - reject - print(f" โŒ Share rejected (hash > stratum target)") + # Normal mode - check stratum difficulty properly + if not meets_stratum_difficulty: + # Share doesn't meet minimum stratum difficulty - reject + print(f" โŒ Share rejected (difficulty too low: {share_difficulty:.2e} < {client_stratum_diff:.6f})") self.stats['total_shares'] += 1 self.stats['rejected_shares'] += 1 - return False, "Share too high" + return False, "Share does not meet stratum difficulty" # Valid stratum share! Update client stats if addr and addr in self.clients: @@ -602,12 +606,12 @@ class RinCoinStratumProxy: # Check if we should adjust difficulty self.adjust_client_difficulty(addr) - # Only submit if it meets network target in normal mode - should_submit = meets_network_target + # Only submit if it meets network difficulty in normal mode + should_submit = meets_network_difficulty # Submit block if conditions are met if should_submit: - if meets_network_target: + if meets_network_difficulty: print(f" ๐ŸŽ‰ VALID BLOCK FOUND! Hash: {block_hash_hex}") else: print(f" ๐Ÿงช TEST BLOCK SUBMISSION! Hash: {block_hash_hex} (submit_all_blocks=True)")