[2.x.x] Writeable protocol version aware (#2856)
* introduce protocol version to deserialize and read * thread protocol version through our reader * cleanup * cleanup * streaming_reader cleanup * Pass protocol version into BinWriter to allow for version specific serialization rules. * rustfmt * read and write now protocol version specific
This commit is contained in:
@@ -76,7 +76,7 @@ impl PoolPushHandler {
|
||||
})
|
||||
.and_then(move |tx_bin| {
|
||||
// TODO - pass protocol version in via the api call?
|
||||
let version = ProtocolVersion::default();
|
||||
let version = ProtocolVersion::local();
|
||||
|
||||
ser::deserialize(&mut &tx_bin[..], version)
|
||||
.map_err(|e| ErrorKind::RequestError(format!("Bad request: {}", e)).into())
|
||||
|
||||
+1
-1
@@ -83,7 +83,7 @@ pub struct Status {
|
||||
impl Status {
|
||||
pub fn from_tip_and_peers(current_tip: chain::Tip, connections: u32) -> Status {
|
||||
Status {
|
||||
protocol_version: ser::ProtocolVersion::default().into(),
|
||||
protocol_version: ser::ProtocolVersion::local().into(),
|
||||
user_agent: p2p::msg::USER_AGENT.to_string(),
|
||||
connections: connections,
|
||||
tip: Tip::from_tip(current_tip),
|
||||
|
||||
Reference in New Issue
Block a user