Don't coneect peers on each sync
This commit is contained in:
parent
fa504e510f
commit
49ae375605
@ -237,6 +237,9 @@ impl<C> TestNet<C> where C: FlushingBlockChainClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn start(&mut self) {
|
pub fn start(&mut self) {
|
||||||
|
if self.started {
|
||||||
|
return;
|
||||||
|
}
|
||||||
for peer in 0..self.peers.len() {
|
for peer in 0..self.peers.len() {
|
||||||
for client in 0..self.peers.len() {
|
for client in 0..self.peers.len() {
|
||||||
if peer != client {
|
if peer != client {
|
||||||
@ -246,6 +249,7 @@ impl<C> TestNet<C> where C: FlushingBlockChainClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
self.started = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn sync_step(&mut self) {
|
pub fn sync_step(&mut self) {
|
||||||
@ -306,10 +310,7 @@ impl<C> TestNet<C> where C: FlushingBlockChainClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn sync_steps(&mut self, count: usize) {
|
pub fn sync_steps(&mut self, count: usize) {
|
||||||
if !self.started {
|
|
||||||
self.start();
|
self.start();
|
||||||
self.started = true;
|
|
||||||
}
|
|
||||||
for _ in 0..count {
|
for _ in 0..count {
|
||||||
self.sync_step();
|
self.sync_step();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user