block: drop Network from the Header

It's not network-tied any more, network is only needed to
sign/verify. Unfortunately we still have to keep network in consensus data
structures because of dbft library interface.
This commit is contained in:
Roman Khimov 2021-03-25 21:46:52 +03:00
parent d314f82db3
commit 95c279325a
28 changed files with 48 additions and 110 deletions

View file

@ -4,15 +4,13 @@ import (
"errors"
"fmt"
"github.com/nspcc-dev/neo-go/pkg/config/netmode"
"github.com/nspcc-dev/neo-go/pkg/core/block"
"github.com/nspcc-dev/neo-go/pkg/io"
)
// Headers payload.
type Headers struct {
Hdrs []*block.Header
Network netmode.Magic
Hdrs []*block.Header
// StateRootInHeader specifies whether header contains state root.
StateRootInHeader bool
}
@ -48,7 +46,6 @@ func (p *Headers) DecodeBinary(br *io.BinReader) {
for i := 0; i < int(lenHeaders); i++ {
header := &block.Header{}
header.Network = p.Network
header.StateRootEnabled = p.StateRootInHeader
header.DecodeBinary(br)
p.Hdrs[i] = header