Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion internal/dns/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ func findNameserversForDomain(
}

// Check on-chain domains first
for startLabelIdx := 0; startLabelIdx < len(queryLabels); startLabelIdx++ {
for startLabelIdx := range queryLabels {
lookupDomainName := strings.Join(queryLabels[startLabelIdx:], ".")
// Convert to canonical form for consistency
lookupDomainName = dns.CanonicalName(lookupDomainName)
Expand Down
6 changes: 3 additions & 3 deletions internal/handshake/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ func (t *TextDomainRecord) decode(r *BytesReader) error {
return err
}
var size uint8
for i := 0; i < int(length); i++ {
for range int(length) {
// Read item size
if err := binary.Read(r, binary.LittleEndian, &size); err != nil {
return err
Expand Down Expand Up @@ -297,7 +297,7 @@ func domainRecordNameDecode(r *BytesReader) (string, error) {
if c > DnsMaxLabel {
return "", errors.New("label too long")
}
for j := 0; j < int(c); j++ {
for range int(c) {
b, err := r.ReadByte()
if err != nil {
return "", err
Expand Down Expand Up @@ -329,7 +329,7 @@ func domainRecordNameDecode(r *BytesReader) (string, error) {
data := r.OriginalBytes()
r = NewBytesReader(data)
// Read and discard bytes until we reach the calculated offset
for j := 0; j < offset; j++ {
for range offset {
if _, err := r.ReadByte(); err != nil {
return "", err
}
Expand Down
4 changes: 2 additions & 2 deletions internal/handshake/spv.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func (p *Proof) Decode(r *bytes.Buffer) error {
return err
}
p.Nodes = make([]ProofNode, count)
for i := 0; i < int(count); i++ {
for i := range int(count) {
item := &ProofNode{}
if hasBit(bitMap, i) {
bits, bytes, err := readBitlen(r)
Expand Down Expand Up @@ -279,7 +279,7 @@ func (p *Proof) has(
x := 0
y := depth
var c uint16
for i := 0; i < int(tmpLen); i++ {
for range int(tmpLen) {
if hasBit(prefix, int(x)) != hasBit(key, int(y)) {
break
}
Expand Down
Loading