Skip to content

Commit

Permalink
[FAB-3645] adding cc bytes instead of its hash
Browse files Browse the repository at this point in the history
Bug in computing the hash caused ChaincodeDeploymentSpec.CodePackage
to be set instead of its hash causing payload bloat.

Change-Id: I83dbea5667b1709e9e22951b19585302b3168033
Signed-off-by: Srinivasan Muralidharan <muralisr@us.ibm.com>
  • Loading branch information
Srinivasan Muralidharan committed May 5, 2017
1 parent 1d31ce3 commit 3d169cc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion core/common/ccprovider/cdspackage.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ func (ccpack *CDSPackage) getCDSData(cds *pb.ChaincodeDeploymentSpec) ([]byte, [
cdsdata := &CDSData{}

//code hash
cdsdata.CodeHash = hash.Sum(cds.CodePackage)
hash.Write(cds.CodePackage)
cdsdata.CodeHash = hash.Sum(nil)

hash.Reset()

Expand Down
3 changes: 2 additions & 1 deletion core/common/ccprovider/sigcdspackage.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ func (ccpack *SignedCDSPackage) getCDSData(scds *pb.SignedChaincodeDeploymentSpe
scdsdata := &SignedCDSData{}

//get the code hash
scdsdata.CodeHash = hash.Sum(cds.CodePackage)
hash.Write(cds.CodePackage)
scdsdata.CodeHash = hash.Sum(nil)

hash.Reset()

Expand Down

0 comments on commit 3d169cc

Please sign in to comment.