We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e0dde43 commit c80d7d4Copy full SHA for c80d7d4
pkg/chaintracks/chainwork_fuzz_test.go
@@ -63,6 +63,12 @@ func FuzzChainWorkFromHex(f *testing.F) {
63
f.Add(string([]byte{0x00, 0x01, 0x02})) // control chars
64
65
f.Fuzz(func(t *testing.T, hexStr string) {
66
+ // Skip unrealistically long inputs to avoid timeout on expensive big.Int operations
67
+ // Bitcoin chainwork is at most 256 bits = 64 hex characters
68
+ if len(hexStr) > 64 {
69
+ return
70
+ }
71
+
72
// Should never panic
73
result, err := ChainWorkFromHex(hexStr)
74
0 commit comments