[2.x.x] deserialization now protocol version aware (#2824)
* introduce protocol version to deserialize and read * thread protocol version through our reader * example protocol version access in kernel read * fix our StreamingReader impl (WouldBlock woes) * debug log progress of txhashset download
This commit is contained in:
@@ -21,6 +21,7 @@ use std::time::SystemTime;
|
||||
|
||||
use crate::core::consensus::graph_weight;
|
||||
use crate::core::core::hash::Hash;
|
||||
use crate::core::ser::ProtocolVersion;
|
||||
|
||||
use chrono::prelude::*;
|
||||
|
||||
@@ -147,7 +148,7 @@ pub struct PeerStats {
|
||||
/// Address
|
||||
pub addr: String,
|
||||
/// version running
|
||||
pub version: p2p::msg::ProtocolVersion,
|
||||
pub version: ProtocolVersion,
|
||||
/// Peer user agent string.
|
||||
pub user_agent: String,
|
||||
/// difficulty reported by peer
|
||||
|
||||
@@ -39,6 +39,7 @@ use crate::common::stats::{DiffBlock, DiffStats, PeerStats, ServerStateInfo, Ser
|
||||
use crate::common::types::{Error, ServerConfig, StratumServerConfig, SyncState, SyncStatus};
|
||||
use crate::core::core::hash::{Hashed, ZERO_HASH};
|
||||
use crate::core::core::verifier_cache::{LruVerifierCache, VerifierCache};
|
||||
use crate::core::ser::ProtocolVersion;
|
||||
use crate::core::{consensus, genesis, global, pow};
|
||||
use crate::grin::{dandelion_monitor, seed, sync};
|
||||
use crate::mining::stratumserver;
|
||||
@@ -414,9 +415,9 @@ impl Server {
|
||||
self.chain.header_head().map_err(|e| e.into())
|
||||
}
|
||||
|
||||
/// Current p2p layer protocol version.
|
||||
pub fn protocol_version() -> p2p::msg::ProtocolVersion {
|
||||
p2p::msg::ProtocolVersion::default()
|
||||
/// The p2p layer protocol version for this node.
|
||||
pub fn protocol_version() -> ProtocolVersion {
|
||||
ProtocolVersion::default()
|
||||
}
|
||||
|
||||
/// Returns a set of stats about this server. This and the ServerStats
|
||||
|
||||
Reference in New Issue
Block a user