@@ -539,7 +539,7 @@ type txns []string
539
539
type blockData [][]byte
540
540
type blockConsumer func (seqInBlock uint64 , chdr * common.ChannelHeader , txRWSet * rwsetutil.TxRwSet , endorsers []* peer.Endorsement )
541
541
542
- func (data blockData ) forEachTxn (txsFilter txValidationFlags , consumer blockConsumer ) ( txns , error ) {
542
+ func (data blockData ) forEachTxn (txsFilter txValidationFlags , consumer blockConsumer ) txns {
543
543
var txList []string
544
544
for seqInBlock , envBytes := range data {
545
545
env , err := utils .GetEnvelopeFromBlock (envBytes )
@@ -601,7 +601,7 @@ func (data blockData) forEachTxn(txsFilter txValidationFlags, consumer blockCons
601
601
}
602
602
consumer (uint64 (seqInBlock ), chdr , txRWSet , ccActionPayload .Action .Endorsements )
603
603
}
604
- return txList , nil
604
+ return txList
605
605
}
606
606
607
607
func endorsersFromOrgs (ns string , col string , endorsers []* peer.Endorsement , orgs []string ) []* peer.Endorsement {
@@ -650,10 +650,7 @@ func (c *coordinator) listMissingPrivateData(block *common.Block, ownedRWsets ma
650
650
privateRWsetsInBlock : privateRWsetsInBlock ,
651
651
coordinator : c ,
652
652
}
653
- txList , err := data .forEachTxn (txsFilter , bi .inspectTransaction )
654
- if err != nil {
655
- return nil , errors .WithStack (err )
656
- }
653
+ txList := data .forEachTxn (txsFilter , bi .inspectTransaction )
657
654
658
655
privateInfo := & privateDataInfo {
659
656
sources : sources ,
@@ -809,12 +806,12 @@ func (ac aggregatedCollections) asPrivateData() []*ledger.TxPvtData {
809
806
func (c * coordinator ) GetPvtDataAndBlockByNum (seqNum uint64 , peerAuthInfo common.SignedData ) (* common.Block , util.PvtDataCollections , error ) {
810
807
blockAndPvtData , err := c .Committer .GetPvtDataAndBlockByNum (seqNum )
811
808
if err != nil {
812
- return nil , nil , fmt . Errorf ( "cannot retrieve block number %d, due to %s" , seqNum , err )
809
+ return nil , nil , err
813
810
}
814
811
815
812
seqs2Namespaces := aggregatedCollections (make (map [seqAndDataModel ]map [string ][]* rwset.CollectionPvtReadWriteSet ))
816
813
data := blockData (blockAndPvtData .Block .Data .Data )
817
- _ , err = data .forEachTxn (make (txValidationFlags , len (data )), func (seqInBlock uint64 , chdr * common.ChannelHeader , txRWSet * rwsetutil.TxRwSet , _ []* peer.Endorsement ) {
814
+ data .forEachTxn (make (txValidationFlags , len (data )), func (seqInBlock uint64 , chdr * common.ChannelHeader , txRWSet * rwsetutil.TxRwSet , _ []* peer.Endorsement ) {
818
815
item , exists := blockAndPvtData .BlockPvtData [seqInBlock ]
819
816
if ! exists {
820
817
return
@@ -846,9 +843,6 @@ func (c *coordinator) GetPvtDataAndBlockByNum(seqNum uint64, peerAuthInfo common
846
843
}
847
844
}
848
845
})
849
- if err != nil {
850
- return nil , nil , errors .WithStack (err )
851
- }
852
846
853
847
return blockAndPvtData .Block , seqs2Namespaces .asPrivateData (), nil
854
848
}
0 commit comments