Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions pushtx/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package pushtx

import (
"fmt"
"slices"
"strings"

"github.com/btcsuite/btcd/wire"
Expand Down Expand Up @@ -75,13 +76,7 @@ func IsBroadcastError(err error, codes ...BroadcastErrorCode) bool {
return false
}

for _, code := range codes {
if broadcastErr.Code == code {
return true
}
}

return false
return slices.Contains(codes, broadcastErr.Code)
}

// ParseBroadcastError maps a peer's reject message for a transaction to a
Expand Down