MCPcopy Create free account
hub / github.com/DNAProject/DNA / verifyStateful

Method verifyStateful

txnpool/proc/txnpool_worker.go:269–299  ·  view source on GitHub ↗

verifyStateful prepares a check request and sends it to the stateful validator

(tx *tx.Transaction)

Source from the content-addressed store, hash-verified

267// verifyStateful prepares a check request and sends it to the
268// stateful validator
269func (worker *txPoolWorker) verifyStateful(tx *tx.Transaction) {
270 req := &types.CheckTx{
271 WorkerId: worker.workId,
272 Tx: tx,
273 }
274
275 // Construct the pending transaction
276 pt := &pendingTx{
277 tx: tx,
278 req: req,
279 retries: 0,
280 valTime: time.Now(),
281 }
282
283 retAttr := &tc.TXAttr{
284 Height: 0,
285 Type: types.Stateless,
286 ErrCode: errors.ErrNoError,
287 }
288
289 pt.ret = append(pt.ret, retAttr)
290 // Since the signature has been already verified, mark stateless as true
291 pt.flag |= tc.STATELESS_MASK
292
293 // Add it to the pending transaction list
294 worker.mu.Lock()
295 worker.pendingTxList[tx.Hash()] = pt
296 worker.mu.Unlock()
297
298 worker.sendReq2StatefulV(req)
299}
300
301// Start is the main event loop.
302func (worker *txPoolWorker) start() {

Callers 1

startMethod · 0.95

Calls 2

sendReq2StatefulVMethod · 0.95
HashMethod · 0.65

Tested by

no test coverage detected