mirror of
https://source.quilibrium.com/quilibrium/ceremonyclient.git
synced 2024-11-15 04:35:17 +00:00
17 lines
349 B
Go
17 lines
349 B
Go
|
package config
|
||
|
|
||
|
import "github.com/libp2p/go-libp2p/core/routing"
|
||
|
|
||
|
type QuorumOptionKey struct{}
|
||
|
|
||
|
const defaultQuorum = 0
|
||
|
|
||
|
// GetQuorum defaults to 0 if no option is found
|
||
|
func GetQuorum(opts *routing.Options) int {
|
||
|
responsesNeeded, ok := opts.Other[QuorumOptionKey{}].(int)
|
||
|
if !ok {
|
||
|
responsesNeeded = defaultQuorum
|
||
|
}
|
||
|
return responsesNeeded
|
||
|
}
|