mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
refactor: replace once_cell Lazy with LazyLock (#9844)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de> Co-authored-by: Oliver <onbjerg@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
a206eb3690
commit
106a0c7cf7
@ -20,4 +20,3 @@ futures.workspace = true
|
||||
tokio.workspace = true
|
||||
|
||||
eyre.workspace = true
|
||||
once_cell.workspace = true
|
||||
|
||||
@ -9,7 +9,6 @@
|
||||
use std::time::Duration;
|
||||
|
||||
use futures::StreamExt;
|
||||
use once_cell::sync::Lazy;
|
||||
use reth_chainspec::{Chain, MAINNET};
|
||||
use reth_discv4::{DiscoveryUpdate, Discv4, Discv4ConfigBuilder, DEFAULT_DISCOVERY_ADDRESS};
|
||||
use reth_ecies::stream::ECIESStream;
|
||||
@ -20,12 +19,13 @@ use reth_network::config::rng_secret_key;
|
||||
use reth_network_peers::{mainnet_nodes, pk2id, NodeRecord};
|
||||
use reth_primitives::{EthereumHardfork, Head, MAINNET_GENESIS_HASH};
|
||||
use secp256k1::{SecretKey, SECP256K1};
|
||||
use std::sync::LazyLock;
|
||||
use tokio::net::TcpStream;
|
||||
|
||||
type AuthedP2PStream = P2PStream<ECIESStream<TcpStream>>;
|
||||
type AuthedEthStream = EthStream<P2PStream<ECIESStream<TcpStream>>>;
|
||||
|
||||
pub static MAINNET_BOOT_NODES: Lazy<Vec<NodeRecord>> = Lazy::new(mainnet_nodes);
|
||||
pub static MAINNET_BOOT_NODES: LazyLock<Vec<NodeRecord>> = LazyLock::new(mainnet_nodes);
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> eyre::Result<()> {
|
||||
|
||||
Reference in New Issue
Block a user