p2p/discover: implement v5.1 wire protocol (#21647)

This change implements the Discovery v5.1 wire protocol and
also adds an interactive test suite for this protocol.
This commit is contained in:
Felix Lange
2020-10-14 12:28:17 +02:00
committed by GitHub
parent 4eb01b21c8
commit 524aaf5ec6
24 changed files with 3236 additions and 1427 deletions

View File

@ -23,3 +23,11 @@ func IsTemporaryError(err error) bool {
})
return ok && tempErr.Temporary() || isPacketTooBig(err)
}
// IsTimeout checks whether the given error is a timeout.
func IsTimeout(err error) bool {
timeoutErr, ok := err.(interface {
Timeout() bool
})
return ok && timeoutErr.Timeout()
}