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

Method process

cmd/cql-eth-exchange/exchange.go:255–284  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

253}
254
255func (e *Exchange) process() {
256 if e.newBlockHeaderCh == nil || e.wg == nil {
257 return
258 }
259
260 defer e.wg.Done()
261 processTick := time.NewTicker(10 * conf.GConf.BPPeriod)
262 defer processTick.Stop()
263
264 for {
265 select {
266 case b := <-e.newBlockCh:
267 _ = e.processBlock(b)
268 case blockHead := <-e.newBlockHeaderCh:
269 e.wg.Add(1)
270 go e.fetchBlock(blockHead)
271 case <-e.processCtx.Done():
272 return
273 case <-processTick.C:
274 // load tx and process
275 e.processPendingTxs()
276 default:
277 // update transferring tx state
278 e.updateTransferringTxState()
279 // update transferring tx state
280 e.expireStaleTx()
281 }
282 }
283
284}
285
286func (e *Exchange) processBlock(b *types.Block) (err error) {
287 // set back to queue

Callers 1

StartMethod · 0.95

Calls 7

processBlockMethod · 0.95
fetchBlockMethod · 0.95
processPendingTxsMethod · 0.95
expireStaleTxMethod · 0.95
StopMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected