Skip to content

Commit 0f0a846

Browse files
committed
[FAB-10263]: fix comments for dist pvt data
Change-Id: Idec22188727673eacce3f91f4ffc0d5e7b44c255 Signed-off-by: Artem Barger <bartem@il.ibm.com>
1 parent f652cbd commit 0f0a846

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

core/endorser/endorser.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,12 +288,15 @@ func (e *Endorser) SimulateProposal(ctx context.Context, chainID string, txid st
288288
if err != nil {
289289
return nil, nil, nil, nil, errors.WithMessage(err, "failed to obtain collections config")
290290
}
291-
endosedAt, err := e.s.GetLedgerHeight(chainID)
291+
endorsedAt, err := e.s.GetLedgerHeight(chainID)
292292
if err != nil {
293293
return nil, nil, nil, nil, errors.WithMessage(err, fmt.Sprint("failed to obtain ledger height for channel", chainID))
294294
}
295-
// Add ledger height at which transaction was endorsed
296-
pvtDataWithConfig.EndorsedAt = endosedAt
295+
// Add ledger height at which transaction was endorsed,
296+
// `endorsedAt` is obtained from the block storage and at times this could be 'endorsement Height + 1'.
297+
// However, since we use this height only to select the configuration, this works for now.
298+
// Ideally, ledger should add support in the simulator as a first class function `GetHeight()`.
299+
pvtDataWithConfig.EndorsedAt = endorsedAt
297300
if err := e.distributePrivateData(chainID, txid, pvtDataWithConfig, simResult.SimulationBlkHt); err != nil {
298301
return nil, nil, nil, nil, err
299302
}

0 commit comments

Comments
 (0)