@@ -42,8 +42,6 @@ const (
42
42
lookupRequestLimit = 3 // max requests against a single node during lookup
43
43
findnodeResultLimit = 16 // applies in FINDNODE handler
44
44
totalNodesResponseLimit = 5 // applies in waitForNodes
45
-
46
- respTimeoutV5 = 700 * time .Millisecond
47
45
)
48
46
49
47
// codecV5 is implemented by v5wire.Codec (and testCodec).
@@ -71,6 +69,7 @@ type UDPv5 struct {
71
69
log log.Logger
72
70
clock mclock.Clock
73
71
validSchemes enr.IdentityScheme
72
+ respTimeout time.Duration
74
73
75
74
// misc buffers used during message handling
76
75
logcontext []interface {}
@@ -158,6 +157,7 @@ func newUDPv5(conn UDPConn, ln *enode.LocalNode, cfg Config) (*UDPv5, error) {
158
157
log : cfg .Log ,
159
158
validSchemes : cfg .ValidSchemes ,
160
159
clock : cfg .Clock ,
160
+ respTimeout : cfg .V5RespTimeout ,
161
161
// channels into dispatch
162
162
packetInCh : make (chan ReadPacket , 1 ),
163
163
readNextCh : make (chan struct {}, 1 ),
@@ -576,7 +576,7 @@ func (t *UDPv5) startResponseTimeout(c *callV5) {
576
576
timer mclock.Timer
577
577
done = make (chan struct {})
578
578
)
579
- timer = t .clock .AfterFunc (respTimeoutV5 , func () {
579
+ timer = t .clock .AfterFunc (t . respTimeout , func () {
580
580
<- done
581
581
select {
582
582
case t .respTimeoutCh <- & callTimeout {c , timer }:
0 commit comments