From dc740bdefe96689fcfaa12ebcc15092ab0780633 Mon Sep 17 00:00:00 2001 From: Alexgao001 Date: Mon, 29 Jul 2024 18:33:21 +0800 Subject: [PATCH] fix: the empty list serialization --- core/blockarchiver/converter.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/blockarchiver/converter.go b/core/blockarchiver/converter.go index fb381a9b82..c75923572e 100644 --- a/core/blockarchiver/converter.go +++ b/core/blockarchiver/converter.go @@ -313,7 +313,10 @@ func convertBlock(block *Block) (*GeneralBlock, error) { txs = append(txs, transaction) } } - newBlock := types.NewBlockWithHeader(header).WithBody(txs, nil) + newBlock := types.NewBlockWithHeader(header).WithBody(txs, make([]*types.Header, 0)) + if header.WithdrawalsHash != nil && *header.WithdrawalsHash == types.EmptyWithdrawalsHash { + newBlock = newBlock.WithWithdrawals(make([]*types.Withdrawal, 0)) + } return &GeneralBlock{ Block: newBlock, TotalDifficulty: totalDifficulty,