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

Method sendBlkResult2Consensus

txnpool/proc/txnpool_server.go:654–671  ·  view source on GitHub ↗

sendBlkResult2Consensus sends the result of verifying block to consensus

()

Source from the content-addressed store, hash-verified

652
653// sendBlkResult2Consensus sends the result of verifying block to consensus
654func (s *TXPoolServer) sendBlkResult2Consensus() {
655 rsp := &tc.VerifyBlockRsp{
656 TxnPool: make([]*tc.VerifyTxResult,
657 0, len(s.pendingBlock.processedTxs)),
658 }
659 for _, v := range s.pendingBlock.processedTxs {
660 rsp.TxnPool = append(rsp.TxnPool, v)
661 }
662
663 if s.pendingBlock.sender != nil {
664 s.pendingBlock.sender.Tell(rsp)
665 }
666
667 // Clear the processedTxs for the next block verify req
668 for k := range s.pendingBlock.processedTxs {
669 delete(s.pendingBlock.processedTxs, k)
670 }
671}
672
673// verifyBlock verifies the block from consensus.
674// There are three cases to handle.

Callers 2

checkPendingBlockOkMethod · 0.95
verifyBlockMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected