From 625d2c0e98bacd1b26541f8b8de783e0d149809a Mon Sep 17 00:00:00 2001 From: Austin Roberts Date: Mon, 18 Oct 2021 15:01:04 -0500 Subject: [PATCH] Make chainconfig wrapper more robust against differences between types --- plugins/wrappers/wrappers.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/wrappers/wrappers.go b/plugins/wrappers/wrappers.go index f757a04c5..ee052eaf0 100644 --- a/plugins/wrappers/wrappers.go +++ b/plugins/wrappers/wrappers.go @@ -606,10 +606,14 @@ func (b *Backend) ChainConfig() *params.ChainConfig { field := ntype.Field(i) v := nval.Elem().FieldByName(field.Name) lv := lval.Elem().FieldByName(field.Name) - if v.Type() == lv.Type() && lv.CanSet() { - lv.Set(v) - } else { - convertAndSet(lv, v) + log.Info("Checking value for", "field", field.Name) + if lv.Kind() != reflect.Invalid { + // If core.ChainConfig doesn't have this field, skip it. + if v.Type() == lv.Type() && lv.CanSet() { + lv.Set(v) + } else { + convertAndSet(lv, v) + } } } return b.chainConfig