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

Method reVerifyStateful

txnpool/proc/txnpool_server.go:633–651  ·  view source on GitHub ↗

reVerifyStateful re-verify a transaction's stateful data.

(tx *tx.Transaction, sender tc.SenderType)

Source from the content-addressed store, hash-verified

631
632// reVerifyStateful re-verify a transaction's stateful data.
633func (s *TXPoolServer) reVerifyStateful(tx *tx.Transaction, sender tc.SenderType) {
634 if ok := s.setPendingTx(tx, sender, nil); !ok {
635 s.increaseStats(tc.DuplicateStats)
636 return
637 }
638
639 // Add the rcvTxn to the worker
640 lb := make(tc.LBSlice, len(s.workers))
641 for i := 0; i < len(s.workers); i++ {
642 entry := tc.LB{Size: len(s.workers[i].stfTxCh) +
643 len(s.workers[i].pendingTxList),
644 WorkerID: uint8(i),
645 }
646 lb[i] = entry
647 }
648
649 sort.Sort(lb)
650 s.workers[lb[0].WorkerID].stfTxCh <- tx
651}
652
653// sendBlkResult2Consensus sends the result of verifying block to consensus
654func (s *TXPoolServer) sendBlkResult2Consensus() {

Callers 3

getTxPoolMethod · 0.95
cleanTransactionListMethod · 0.95
verifyBlockMethod · 0.95

Calls 2

setPendingTxMethod · 0.95
increaseStatsMethod · 0.95

Tested by

no test coverage detected