Skip to content

Commit

Permalink
fix: don't display an error when there is no message to be read in ta…
Browse files Browse the repository at this point in the history
…ri_mining_node (#3409)

Description
---
Fixes a minor bug introduced by accident in PR#3396 causing terminal and logs to be peppered with errors for tari_mining_node (mining against a pool) where no action should be taken instead.

Motivation and Context
---
Prevents the following message from being incorrectly reported:
```
ERROR Error reading message: None
```

How Has This Been Tested?
---
Manually
  • Loading branch information
StriderDM authored Oct 5, 2021
1 parent 7c13fde commit eb4b560
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion applications/tari_mining_node/src/stratum/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,12 +349,14 @@ impl Controller {
error!("Error parsing message: {}", m)
}
},
Ok(None) => {
// noop, nothing to read for this interval
},
Err(e) => {
error!("Error reading message: {:?}", e);
self.stream = None;
continue;
},
_ => error!("Error reading message: None"),
}
next_server_read = time::get_time().sec + server_read_interval;
}
Expand Down

0 comments on commit eb4b560

Please sign in to comment.