vspd: Extract const time period for dcrd check.

This commit is contained in:
jholdstock 2023-09-05 15:48:40 +01:00 committed by Jamie Holdstock
parent 030a4c6874
commit cfc34a3adc

View File

@ -34,6 +34,9 @@ const (
// consistencyInterval is the time period between wallet consistency checks. // consistencyInterval is the time period between wallet consistency checks.
consistencyInterval = 30 * time.Minute consistencyInterval = 30 * time.Minute
// dcrdInterval is the time period between dcrd connection checks.
dcrdInterval = time.Second * 15
) )
type vspd struct { type vspd struct {
@ -197,7 +200,7 @@ func (v *vspd) run() int {
case <-shutdownCtx.Done(): case <-shutdownCtx.Done():
shutdownWg.Done() shutdownWg.Done()
return return
case <-time.After(time.Second * 15): case <-time.After(dcrdInterval):
// Ensure dcrd client is still connected. // Ensure dcrd client is still connected.
_, _, err := v.dcrd.Client() _, _, err := v.dcrd.Client()
if err != nil { if err != nil {