Skip to content

Commit

Permalink
[FAB-5671] Fixed SCC persistence
Browse files Browse the repository at this point in the history
Change-Id: I146e237b99a92788ee68ccd326e42b0d40b23348
Signed-off-by: Aleksandar Likic <aleksandar.likic@securekey.com>
  • Loading branch information
Aleksandar Likic committed Aug 13, 2017
1 parent 741c67c commit faea049
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions core/committer/txvalidator/validator.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
/*
Copyright IBM Corp. 2016 All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
SPDX-License-Identifier: Apache-2.0
*/

package txvalidator
Expand Down Expand Up @@ -403,9 +393,9 @@ func (v *vsccValidatorImpl) GetInfoForValidate(txid, chID, ccID string) (*sysccp
vscc := &sysccprovider.ChaincodeInstance{ChainID: chID}
var policy []byte
var err error
if ccID != "lscc" {
// when we are validating any chaincode other than
// LSCC, we need to ask LSCC to give us the name
if !sysccprovider.GetSystemChaincodeProvider().IsSysCC(ccID) {
// when we are validating a chaincode that is not a
// system CC, we need to ask the CC to give us the name
// of VSCC and of the policy that should be used

// obtain name of the VSCC and the policy from LSCC
Expand All @@ -420,10 +410,10 @@ func (v *vsccValidatorImpl) GetInfoForValidate(txid, chID, ccID string) (*sysccp
vscc.ChaincodeName = cd.Vscc
policy = cd.Policy
} else {
// when we are validating LSCC, we use the default
// when we are validating a system CC, we use the default
// VSCC and a default policy that requires one signature
// from any of the members of the channel
cc.ChaincodeName = "lscc"
cc.ChaincodeName = ccID
cc.ChaincodeVersion = coreUtil.GetSysCCVersion()
vscc.ChaincodeName = "vscc"
p := cauthdsl.SignedByAnyMember(v.support.GetMSPIDs(chID))
Expand Down

0 comments on commit faea049

Please sign in to comment.