MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / isMyTurn

Method isMyTurn

sqlchain/runtime.go:304–316  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

302}
303
304func (r *runtime) isMyTurn() (ret bool) {
305 index, total := r.getIndexTotal()
306 r.stateMutex.Lock()
307 defer r.stateMutex.Unlock()
308
309 if r.total <= 0 {
310 ret = false
311 } else {
312 ret = (r.nextTurn%total == index)
313 }
314
315 return
316}
317
318func (r *runtime) getPeers() *proto.Peers {
319 r.peersMutex.Lock()

Callers 1

runCurrentTurnMethod · 0.45

Calls 1

getIndexTotalMethod · 0.95

Tested by

no test coverage detected