Revert "return [] instead of null for withdrawals (#7279)" (#7292)

Pre-Shanghai blocks should have `nil` withdrawals, while post-Shanghai
blocks should have non-nil withdrawals (empty or non-empty slice, but
not `nil`). Judging from Issue #6976, that's not always a case. PR #7279
attempted to fix the issue, but unfortunately it only masks the root
cause.

This reverts commit c60a6a2962.
This commit is contained in:
Andrew Ashikhmin 2023-04-11 15:39:41 +02:00 committed by GitHub
parent db52bbafb3
commit 7b576e9fda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -341,11 +341,6 @@ func RPCMarshalBlockExDeprecated(block *types.Block, inclTx bool, fullTx bool, b
fields["withdrawals"] = block.Withdrawals()
}
// Ensure that withdrawals is not null at all times.
if fields["withdrawals"] == nil {
fields["withdrawals"] = []*types.Withdrawal{}
}
return fields, nil
}