internal/ethapi: remove error return on RPCMarshalBlock (#27449)

rm error when marshal block to rpc type allen
This commit is contained in:
hero5512
2023-06-13 03:02:11 -04:00
committed by GitHub
parent 174d267f48
commit 5ac4da3653
3 changed files with 6 additions and 16 deletions
+1 -4
View File
@@ -104,7 +104,6 @@ type BadBlockArgs struct {
// and returns them as a JSON list of block hashes.
func (api *DebugAPI) GetBadBlocks(ctx context.Context) ([]*BadBlockArgs, error) {
var (
err error
blocks = rawdb.ReadAllBadBlocks(api.eth.chainDb)
results = make([]*BadBlockArgs, 0, len(blocks))
)
@@ -118,9 +117,7 @@ func (api *DebugAPI) GetBadBlocks(ctx context.Context) ([]*BadBlockArgs, error)
} else {
blockRlp = fmt.Sprintf("%#x", rlpBytes)
}
if blockJSON, err = ethapi.RPCMarshalBlock(block, true, true, api.eth.APIBackend.ChainConfig()); err != nil {
blockJSON = map[string]interface{}{"error": err.Error()}
}
blockJSON = ethapi.RPCMarshalBlock(block, true, true, api.eth.APIBackend.ChainConfig())
results = append(results, &BadBlockArgs{
Hash: block.Hash(),
RLP: blockRlp,