-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Conversation
does |
hehe, go ahead. |
ethcore/sync/src/chain/propagator.rs
Outdated
@@ -48,7 +48,7 @@ fn accepts_service_transaction(client_id: &str) -> bool { | |||
// Parity versions starting from this will accept service-transactions | |||
const SERVICE_TRANSACTIONS_VERSION: (u32, u32) = (1u32, 6u32); | |||
// Parity client string prefix | |||
const PARITY_CLIENT_ID_PREFIX: &'static str = "Parity/v"; | |||
const PARITY_CLIENT_ID_PREFIX: &'static str = "Parity-Ethereum/v"; | |||
|
|||
if !client_id.starts_with(PARITY_CLIENT_ID_PREFIX) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we checking compatibility via version string here? If yes, do you want me to check for both?
const LEGACY_CLIENT_ID_PREFIX: &'static str = "Parity/v";
const PARITY_CLIENT_ID_PREFIX: &'static str = "Parity-Ethereum/v";
if !client_id.starts_with(LEGACY_CLIENT_ID_PREFIX) && !client_id.starts_with(PARITY_CLIENT_ID_PREFIX) {
// ...
}
Ref #4215 CC @svyatonik
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm with minor whitespace grumbles.
ethcore/sync/src/chain/propagator.rs
Outdated
return false; | ||
} | ||
if client_id.starts_with(LEGACY_CLIENT_ID_PREFIX) { | ||
let ver: Vec<u32> = client_id[LEGACY_CLIENT_ID_PREFIX.len()..].split('.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line should be indented (and the 4 following lines as well).
ethcore/sync/src/chain/propagator.rs
Outdated
.filter_map(|s| s.parse().ok()) | ||
.collect(); | ||
ver.len() == 2 && (ver[0] > SERVICE_TRANSACTIONS_VERSION.0 || (ver[0] == SERVICE_TRANSACTIONS_VERSION.0 && ver[1] >= SERVICE_TRANSACTIONS_VERSION.1)) | ||
} else if client_id.starts_with(PARITY_CLIENT_ID_PREFIX) { | ||
let ver: Vec<u32> = client_id[PARITY_CLIENT_ID_PREFIX.len()..].split('.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation like above
ethcore/sync/src/chain/propagator.rs
Outdated
.collect(); | ||
ver.len() == 2 && (ver[0] > SERVICE_TRANSACTIONS_VERSION.0 || (ver[0] == SERVICE_TRANSACTIONS_VERSION.0 && ver[1] >= SERVICE_TRANSACTIONS_VERSION.1)) | ||
} else if client_id.starts_with(PARITY_CLIENT_ID_PREFIX) { | ||
let ver: Vec<u32> = client_id[PARITY_CLIENT_ID_PREFIX.len()..].split('.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be cleaner to do the split in the ifs, and then the rest outside :
let split = if ... { ...split() } else if { ...split() } else { return false };
let ver: Vec<u32> = ...
Ok, this finally works. Thanks @ngotchac! |
parity
cratetoparity-ethereum