internal/ethapi: remove error return on RPCMarshalBlock (#27449)
rm error when marshal block to rpc type allen
This commit is contained in:
+1
-4
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user