From b8adc36e6a9724c11c3289ec647ea431f40e732e Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Fri, 30 Aug 2019 19:34:26 +0300 Subject: [PATCH] transaction: add missing alloc in state decoder Fixes panic two lines below: panic: runtime error: index out of range [recovered] panic: runtime error: index out of range --- pkg/core/transaction/state.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/core/transaction/state.go b/pkg/core/transaction/state.go index 8c37d822a..66636aebb 100644 --- a/pkg/core/transaction/state.go +++ b/pkg/core/transaction/state.go @@ -18,6 +18,7 @@ func (tx *StateTX) DecodeBinary(r io.Reader) error { if br.Err != nil { return br.Err } + tx.Descriptors = make([]*StateDescriptor, lenDesc) for i := 0; i < int(lenDesc); i++ { tx.Descriptors[i] = &StateDescriptor{} if err := tx.Descriptors[i].DecodeBinary(r); err != nil {