Skip to content

Commit

Permalink
Fix block desrialization
Browse files Browse the repository at this point in the history
  • Loading branch information
raychu86 committed Aug 22, 2022
1 parent 330f499 commit 63c20d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions snarkos/network/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,9 @@ pub async fn handle_listener<N: Network>(listener: TcpListener, ledger: Arc<Ledg
/// Request the genesis block from the leader.
pub(super) async fn request_genesis_block<N: Network>(leader_ip: &SocketAddr) -> Result<Block<N>> {
let ip = leader_ip.ip();
let bytes = reqwest::get(format!("http://{ip}/testnet3/block/0")).await?.bytes().await?;
let block_string = reqwest::get(format!("http://{ip}/testnet3/block/0")).await?.text().await?;

Block::from_bytes_le(&bytes)
Block::from_str(&block_string)
}

/// Send a ping to all peers every 10 seconds.
Expand Down

0 comments on commit 63c20d7

Please sign in to comment.