mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-08 04:18:01 +00:00
Add warning when using default protocol ID (#2234)
* Add warning when using default protocol ID * Update core/service/src/lib.rs
This commit is contained in:
committed by
Bastian Köcher
parent
cb766e5f5d
commit
e57e54ab9c
@@ -154,7 +154,15 @@ impl<Components: components::Components> Service<Components> {
|
||||
};
|
||||
|
||||
let protocol_id = {
|
||||
let protocol_id_full = config.chain_spec.protocol_id().unwrap_or(DEFAULT_PROTOCOL_ID).as_bytes();
|
||||
let protocol_id_full = match config.chain_spec.protocol_id() {
|
||||
Some(pid) => pid,
|
||||
None => {
|
||||
warn!("Using default protocol ID {:?} because none is configured in the \
|
||||
chain specs", DEFAULT_PROTOCOL_ID
|
||||
);
|
||||
DEFAULT_PROTOCOL_ID
|
||||
}
|
||||
}.as_bytes();
|
||||
let mut protocol_id = network::ProtocolId::default();
|
||||
if protocol_id_full.len() > protocol_id.len() {
|
||||
warn!("Protocol ID truncated to {} chars", protocol_id.len());
|
||||
|
||||
Reference in New Issue
Block a user