Skip to content

Commit f14c9e5

Browse files
authored
fix: protect against panic when updating pparams from Conway genesis (#776)
1 parent d75eff5 commit f14c9e5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ledger/conway/pparams.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,9 @@ func (p *ConwayProtocolParameters) UpdateFromGenesis(genesis *ConwayGenesis) {
226226
}
227227
}
228228
if len(genesis.PlutusV3CostModel) > 0 {
229+
if p.CostModels == nil {
230+
p.CostModels = make(map[uint][]int64)
231+
}
229232
p.CostModels[2] = genesis.PlutusV3CostModel
230233
}
231234
if genesis.PoolVotingThresholds.MotionNoConfidence != nil {

0 commit comments

Comments
 (0)