sendBlkResult2Consensus sends the result of verifying block to consensus
()
| 652 | |
| 653 | // sendBlkResult2Consensus sends the result of verifying block to consensus |
| 654 | func (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. |
no outgoing calls
no test coverage detected