Skip to content

Commit

Permalink
Merge "[FAB-2455] Fix misleading log statment"
Browse files Browse the repository at this point in the history
  • Loading branch information
Srinivasan Muralidharan authored and Gerrit Code Review committed Mar 3, 2017
2 parents d08e9d7 + d881a6c commit 2dd7a75
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions core/endorser/endorser.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,15 @@ func (*Endorser) checkACL(signedProp *pb.SignedProposal, chdr *common.ChannelHea
}
// access the policy to use to validate this proposal
var policy policies.Policy
var policyName string
if syscc.IsSysCC(hdrext.ChaincodeId.Name) {
// in the case of a system chaincode, we use the admin policy
policy, _ = pm.GetPolicy(policies.ChannelApplicationAdmins)
policyName = policies.ChannelApplicationAdmins
} else {
// in the case of a normal chaincode, we use the writers policy
policy, _ = pm.GetPolicy(policies.ChannelApplicationWriters)
policyName = policies.ChannelApplicationWriters
}
policy, _ := pm.GetPolicy(policyName)
// evaluate that this proposal complies with the writers
err := policy.Evaluate(
Expand All @@ -84,7 +85,8 @@ func (*Endorser) checkACL(signedProp *pb.SignedProposal, chdr *common.ChannelHea
Signature: signedProp.Signature,
}})
if err != nil {
return fmt.Errorf("The proposal does not comply with the channel writers for channel %s, error %s",
return fmt.Errorf("The proposal does not comply with the %s for channel %s, error %s",
policyName,
chdr.ChannelId,
err)
}
Expand Down

0 comments on commit 2dd7a75

Please sign in to comment.