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

Method getHeightFromTime

sqlchain/runtime.go:221–223  ·  view source on GitHub ↗

getHeightFromTime calculates the height with this sql-chain config of a given time reading.

(t time.Time)

Source from the content-addressed store, hash-verified

219
220// getHeightFromTime calculates the height with this sql-chain config of a given time reading.
221func (r *runtime) getHeightFromTime(t time.Time) int32 {
222 return int32(t.Sub(r.chainInitTime) / r.period)
223}
224
225// nextTick returns the current clock reading and the duration till the next turn. If duration
226// is less or equal to 0, use the clock reading to run the next cycle - this avoids some problem

Callers 12

queryTimeIsExpiredMethod · 0.95
NewChainWithContextFunction · 0.80
pushBlockMethod · 0.80
pushAckedQueryMethod · 0.80
produceBlockMethod · 0.80
syncMethod · 0.80
processBlocksMethod · 0.80
CheckAndPushNewBlockMethod · 0.80
AddResponseMethod · 0.80
registerMethod · 0.80
removeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected