MCPcopy Create free account
hub / github.com/chain/Core / checkMultiSigParams

Function checkMultiSigParams

protocol/vmutil/script.go:138–152  ·  view source on GitHub ↗
(nrequired, npubkeys int64)

Source from the content-addressed store, hash-verified

136}
137
138func checkMultiSigParams(nrequired, npubkeys int64) error {
139 if nrequired < 0 {
140 return errors.WithDetail(ErrBadValue, "negative quorum")
141 }
142 if npubkeys < 0 {
143 return errors.WithDetail(ErrBadValue, "negative pubkey count")
144 }
145 if nrequired > npubkeys {
146 return errors.WithDetail(ErrBadValue, "quorum too big")
147 }
148 if nrequired == 0 && npubkeys > 0 {
149 return errors.WithDetail(ErrBadValue, "quorum empty with non-empty pubkey list")
150 }
151 return nil
152}

Callers 4

BlockMultiSigProgramFunction · 0.85
P2SPMultiSigProgramFunction · 0.85
ParseP2SPMultiSigProgramFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected