Skip to content

Commit

Permalink
handle for collision
Browse files Browse the repository at this point in the history
  • Loading branch information
ClaytonNorthey92 committed May 29, 2024
1 parent 64c8b05 commit 475a394
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions database/bfgd/database_ext_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1736,9 +1736,16 @@ func TestBtcHeightsNoChildren(t *testing.T) {
if _, err := rand.Read(hash); err != nil {
t.Fatal(err)
}

header := make([]byte, 80)
if _, err := rand.Read(header); err != nil {
t.Fatal(err)
for {
if _, err := rand.Read(header); err != nil {
t.Fatal(err)
}

if !slices.Equal(hash, header[5:37]) {
break
}
}

if len(prevHash) > 0 {
Expand Down

0 comments on commit 475a394

Please sign in to comment.