@@ -2,7 +2,6 @@ package parser
22
33import (
44 "encoding/hex"
5- "fmt"
65 "strings"
76 "unicode"
87)
@@ -37,10 +36,10 @@ func ParseCoinbaseScript(scriptHex string) string {
3736
3837 // Clean up the text
3938 result := strings .TrimSpace (text .String ())
40-
39+
4140 // Remove excessive spaces
4241 result = strings .Join (strings .Fields (result ), " " )
43-
42+
4443 return result
4544}
4645
@@ -57,7 +56,7 @@ func ExtractMinerInfo(coinbaseText string) string {
5756 }
5857
5958 lowerText := strings .ToLower (coinbaseText )
60-
59+
6160 for poolName , patterns := range poolPatterns {
6261 for _ , pattern := range patterns {
6362 if strings .Contains (lowerText , strings .ToLower (pattern )) {
@@ -87,18 +86,18 @@ func CalculateBlockReward(height uint32) uint64 {
8786 // BSV block reward schedule
8887 // Initial reward: 50 BSV = 5,000,000,000 satoshis
8988 // Halving every 210,000 blocks
90-
89+
9190 const initialReward = uint64 (5000000000 ) // 50 BSV in satoshis
9291 const halvingInterval = uint32 (210000 )
93-
92+
9493 halvings := height / halvingInterval
95-
94+
9695 // Block reward halves every 210,000 blocks
9796 reward := initialReward
9897 for i := uint32 (0 ); i < halvings ; i ++ {
9998 reward = reward / 2
10099 }
101-
100+
102101 return reward
103102}
104103
@@ -157,10 +156,10 @@ func CleanCoinbaseText(text string) string {
157156 }
158157 return - 1
159158 }, text )
160-
159+
161160 // Trim and remove excessive whitespace
162161 cleaned = strings .TrimSpace (cleaned )
163162 cleaned = strings .Join (strings .Fields (cleaned ), " " )
164-
163+
165164 return cleaned
166- }
165+ }
0 commit comments