From c774d089f93e1cb4893871a1d9ee0a4001feadfd Mon Sep 17 00:00:00 2001 From: Aurora Gaffney Date: Wed, 30 Oct 2024 10:31:05 -0500 Subject: [PATCH] fix: protect against panic when updating pparams from Conway genesis --- ledger/conway/pparams.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ledger/conway/pparams.go b/ledger/conway/pparams.go index fca11b66..822ac8cf 100644 --- a/ledger/conway/pparams.go +++ b/ledger/conway/pparams.go @@ -226,6 +226,9 @@ func (p *ConwayProtocolParameters) UpdateFromGenesis(genesis *ConwayGenesis) { } } if len(genesis.PlutusV3CostModel) > 0 { + if p.CostModels == nil { + p.CostModels = make(map[uint][]int64) + } p.CostModels[2] = genesis.PlutusV3CostModel } if genesis.PoolVotingThresholds.MotionNoConfidence != nil {