verifyStateful prepares a check request and sends it to the stateful validator
(tx *tx.Transaction)
| 267 | // verifyStateful prepares a check request and sends it to the |
| 268 | // stateful validator |
| 269 | func (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. |
| 302 | func (worker *txPoolWorker) start() { |
no test coverage detected