GetBlocks used to retrieve blocks with sequence numbers provided in the slice
(blockSeqs []uint64)
| 100 | |
| 101 | // GetBlocks used to retrieve blocks with sequence numbers provided in the slice |
| 102 | func (lc *LedgerCommitter) GetBlocks(blockSeqs []uint64) []*common.Block { |
| 103 | var blocks []*common.Block |
| 104 | |
| 105 | for _, seqNum := range blockSeqs { |
| 106 | if blck, err := lc.GetBlockByNumber(seqNum); err != nil { |
| 107 | logger.Errorf("Not able to acquire block num %d, from the ledger skipping...", seqNum) |
| 108 | continue |
| 109 | } else { |
| 110 | logger.Debug("Appending next block with seqNum = ", seqNum, " to the resulting set") |
| 111 | blocks = append(blocks, blck) |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | return blocks |
| 116 | } |