This repository was archived by the owner on Apr 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed
pkg/fab/events/client/peerresolver/minblockheight Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -169,4 +169,19 @@ func TestOpts(t *testing.T) {
169169 assert .Equal (t , 9 , params .reconnectBlockHeightLagThreshold )
170170 })
171171
172+ t .Run ("No filter" , func (t * testing.T ) {
173+ policy := fab.EventServicePolicy {
174+ BlockHeightLagThreshold : - 1 ,
175+ MinBlockHeightResolverMode : fab .ResolveByThreshold ,
176+ }
177+ config .SetCustomChannelConfig (channelID , & fab.ChannelEndpointConfig {
178+ Policies : fab.ChannelPolicies {
179+ EventService : policy ,
180+ },
181+ })
182+
183+ params := defaultParams (context , channelID )
184+ require .NotNil (t , params )
185+ assert .Equal (t , - 1 , params .blockHeightLagThreshold )
186+ })
172187}
Original file line number Diff line number Diff line change @@ -104,10 +104,6 @@ func getBlockHeightLagThreshold(policy fab.EventServicePolicy) int {
104104 threshold = 0
105105 case fab .ResolveByThreshold :
106106 threshold = policy .BlockHeightLagThreshold
107- if threshold <= 0 {
108- logger .Warnf ("Invalid BlockHeightLagThreshold: %d. Using default: %d" , threshold , defaultBlockHeightLagThreshold )
109- threshold = defaultBlockHeightLagThreshold
110- }
111107 default :
112108 logger .Warnf ("Invalid MinBlockHeightResolverMode: [%s]. Using default: [%s]" , policy .MinBlockHeightResolverMode , fab .ResolveByThreshold )
113109 threshold = policy .BlockHeightLagThreshold
You can’t perform that action at this time.
0 commit comments