Skip to content

Commit 92dd847

Browse files
author
Srinivasan Muralidharan
committed
FAB-2357 join failed looking up ledger
https://jira.hyperledger.org/browse/FAB-2357 Not all proposals are on channels (and have a ledger). Some proposals such as to the CSCC for join is "channelless". In this instance, the failure is due to attempting to access the ledger for doing TX uniqueness checks. Given there's no ledger, we have to bypass ledger based uniqueness checks. Change-Id: I3dbdf49307989575494efc15f3586bd4a85c41cb Signed-off-by: Srinivasan Muralidharan <[email protected]>
1 parent 2ecb22a commit 92dd847

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

core/endorser/endorser.go

+10-6
Original file line numberDiff line numberDiff line change
@@ -296,12 +296,16 @@ func (e *Endorser) ProcessProposal(ctx context.Context, signedProp *pb.SignedPro
296296
return &pb.ProposalResponse{Response: &pb.Response{Status: 500, Message: err.Error()}}, err
297297
}
298298

299-
lgr := peer.GetLedger(chainID)
300-
if lgr == nil {
301-
return nil, errors.New("Failure while looking up the ledger")
302-
}
303-
if _, err := lgr.GetTransactionByID(txid); err == nil {
304-
return nil, fmt.Errorf("Duplicate transaction found [%s]. Creator [%x]. [%s]", txid, hdr.SignatureHeader.Creator, err)
299+
//chainless proposals do not/cannot affect ledger and cannot be submitted as transactions
300+
//ignore uniqueness checks
301+
if !ischainless {
302+
lgr := peer.GetLedger(chainID)
303+
if lgr == nil {
304+
return nil, errors.New(fmt.Sprintf("Failure while looking up the ledger %s", chainID))
305+
}
306+
if _, err := lgr.GetTransactionByID(txid); err == nil {
307+
return nil, fmt.Errorf("Duplicate transaction found [%s]. Creator [%x]. [%s]", txid, hdr.SignatureHeader.Creator, err)
308+
}
305309
}
306310

307311
// obtaining once the tx simulator for this proposal. This will be nil

0 commit comments

Comments
 (0)