MCPcopy Create free account
hub / github.com/BitVM/BitVM / handle_automatic_command

Method handle_automatic_command

bridge/src/client/cli/client_command.rs:385–401  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

383 }
384
385 pub async fn handle_automatic_command(&mut self) -> io::Result<()> {
386 loop {
387 self.client.sync().await;
388
389 let old_data = self.client.data().clone();
390
391 self.client.process_peg_ins().await;
392 self.client.process_peg_outs().await;
393
394 // A bit inefficient, but fine for now: only flush if data changed
395 if self.client.data() != &old_data {
396 self.client.flush().await;
397 } else {
398 sleep(Duration::from_millis(250)).await;
399 }
400 }
401 }
402
403 // TODO: there are verifier's commands missing here
404 pub fn get_broadcast_command() -> Command {

Callers 2

mainFunction · 0.80

Calls 6

cloneMethod · 0.80
dataMethod · 0.80
process_peg_insMethod · 0.80
process_peg_outsMethod · 0.80
syncMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected