Merge pull request #761 from filecoin-project/fix/array-copy-to-slice

one more occurance of the array copy bug
This commit is contained in:
Jakub Sztandera 2019-12-06 11:23:26 +01:00 committed by GitHub
commit 580810668b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -138,8 +138,10 @@ func WriteGenesisMiner(maddr address.Address, sbroot string, gm *genesis.Genesis
func createDeals(m *genesis.GenesisMiner, k *wallet.Key, maddr address.Address, ssize uint64) error {
for _, sector := range m.Sectors {
pref := make([]byte, len(sector.CommD))
copy(pref, sector.CommD[:])
proposal := &actors.StorageDealProposal{
PieceRef: sector.CommD[:], // just one deal so this == CommP
PieceRef: pref, // just one deal so this == CommP
PieceSize: sectorbuilder.UserBytesForSectorSize(ssize),
PieceSerialization: actors.SerializationUnixFSv0,
Client: k.Address,