|
|
@ -19,6 +19,7 @@ package dnsdisc |
|
|
|
import ( |
|
|
|
import ( |
|
|
|
"bytes" |
|
|
|
"bytes" |
|
|
|
"context" |
|
|
|
"context" |
|
|
|
|
|
|
|
"errors" |
|
|
|
"fmt" |
|
|
|
"fmt" |
|
|
|
"math/rand" |
|
|
|
"math/rand" |
|
|
|
"net" |
|
|
|
"net" |
|
|
@ -204,7 +205,7 @@ func (c *Client) doResolveEntry(ctx context.Context, domain, hash string) (entry |
|
|
|
} |
|
|
|
} |
|
|
|
for _, txt := range txts { |
|
|
|
for _, txt := range txts { |
|
|
|
e, err := parseEntry(txt, c.cfg.ValidSchemes) |
|
|
|
e, err := parseEntry(txt, c.cfg.ValidSchemes) |
|
|
|
if err == errUnknownEntry { |
|
|
|
if errors.Is(err, errUnknownEntry) { |
|
|
|
continue |
|
|
|
continue |
|
|
|
} |
|
|
|
} |
|
|
|
if !bytes.HasPrefix(crypto.Keccak256([]byte(txt)), wantHash) { |
|
|
|
if !bytes.HasPrefix(crypto.Keccak256([]byte(txt)), wantHash) { |
|
|
@ -281,7 +282,7 @@ func (it *randomIterator) nextNode() *enode.Node { |
|
|
|
} |
|
|
|
} |
|
|
|
n, err := ct.syncRandom(it.ctx) |
|
|
|
n, err := ct.syncRandom(it.ctx) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
if err == it.ctx.Err() { |
|
|
|
if errors.Is(err, it.ctx.Err()) { |
|
|
|
return nil // context canceled.
|
|
|
|
return nil // context canceled.
|
|
|
|
} |
|
|
|
} |
|
|
|
it.c.cfg.Logger.Debug("Error in DNS random node sync", "tree", ct.loc.domain, "err", err) |
|
|
|
it.c.cfg.Logger.Debug("Error in DNS random node sync", "tree", ct.loc.domain, "err", err) |
|
|
|