mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
fix: manually override certain chainconfig fields for adminNodeInfo (#8874)
This commit is contained in:
@ -4,7 +4,7 @@ use async_trait::async_trait;
|
||||
use jsonrpsee::core::RpcResult;
|
||||
use reth_network_api::{NetworkInfo, PeerKind, Peers};
|
||||
use reth_network_peers::AnyNode;
|
||||
use reth_primitives::{ChainSpec, NodeRecord};
|
||||
use reth_primitives::{ChainConfig, ChainSpec, NodeRecord};
|
||||
use reth_rpc_api::AdminApiServer;
|
||||
use reth_rpc_types::{
|
||||
admin::{EthProtocolInfo, NodeInfo, Ports, ProtocolInfo},
|
||||
@ -94,7 +94,14 @@ where
|
||||
async fn node_info(&self) -> RpcResult<NodeInfo> {
|
||||
let enode = self.network.local_node_record();
|
||||
let status = self.network.network_status().await.to_rpc_result()?;
|
||||
let config = self.chain_spec.genesis().config.clone();
|
||||
let config = ChainConfig {
|
||||
chain_id: self.chain_spec.chain.id(),
|
||||
terminal_total_difficulty_passed: self
|
||||
.chain_spec
|
||||
.get_final_paris_total_difficulty()
|
||||
.is_some(),
|
||||
..self.chain_spec.genesis().config.clone()
|
||||
};
|
||||
|
||||
let node_info = NodeInfo {
|
||||
id: B256::from_slice(&enode.id.as_slice()[..32]),
|
||||
|
||||
Reference in New Issue
Block a user