From 4b168f343c4198487add11e2c5a87403d9bb1435 Mon Sep 17 00:00:00 2001 From: AnkushinDaniil Date: Tue, 10 Dec 2024 12:09:10 +0700 Subject: [PATCH] Move commits closer to usage --- p2p/starknet/handlers.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/p2p/starknet/handlers.go b/p2p/starknet/handlers.go index 8e6b939e2..102fba412 100644 --- a/p2p/starknet/handlers.go +++ b/p2p/starknet/handlers.go @@ -143,11 +143,12 @@ func (h *Handler) onHeadersRequest(req *spec.BlockHeadersRequest) (iter.Seq[prot return nil, err } - var commitments *core.BlockCommitments blockVer, err := core.ParseBlockVersion(header.ProtocolVersion) if err != nil { return nil, err } + + var commitments *core.BlockCommitments if blockVer.LessThan(core.Ver0_13_2) { block, err := it.Block() if err != nil {