Skip to content

Commit faea049

Browse files
author
Aleksandar Likic
committed
[FAB-5671] Fixed SCC persistence
Change-Id: I146e237b99a92788ee68ccd326e42b0d40b23348 Signed-off-by: Aleksandar Likic <aleksandar.likic@securekey.com>
1 parent 741c67c commit faea049

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

core/committer/txvalidator/validator.go

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,7 @@
11
/*
22
Copyright IBM Corp. 2016 All Rights Reserved.
33
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
4+
SPDX-License-Identifier: Apache-2.0
155
*/
166

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

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

0 commit comments

Comments
 (0)