Skip to content

Commit 030380e

Browse files
fix: sync: relax syncer option validation (#336)
fix #335
1 parent 9b03087 commit 030380e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sync/options.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ func (p *Parameters) Validate() error {
6767
if p.TrustingPeriod == 0 {
6868
return fmt.Errorf("invalid TrustingPeriod duration: %v", p.TrustingPeriod)
6969
}
70-
if (p.SyncFromHeight == 0 || p.SyncFromHash == "") && p.PruningWindow == 0 {
70+
if p.SyncFromHash == "" && p.PruningWindow == 0 && p.SyncFromHeight == 0 {
7171
return fmt.Errorf(
72-
"PruningWindow duration can't be zero when either of SyncFromHeight or SyncFromHash are not set",
72+
"at least one of SyncFromHeight, SyncFromHash, or PruningWindow must be set",
7373
)
7474
}
7575
_, err := p.Hash()

0 commit comments

Comments
 (0)