Avoiding possible overflow when block number gets smaller.
This commit is contained in:
parent
6e666ecac7
commit
a36ac996a0
@ -154,8 +154,8 @@ impl MinerService for Miner {
|
|||||||
let should_disable_sealing = {
|
let should_disable_sealing = {
|
||||||
let current_no = chain.chain_info().best_block_number;
|
let current_no = chain.chain_info().best_block_number;
|
||||||
let last_request = self.sealing_block_last_request.lock().unwrap();
|
let last_request = self.sealing_block_last_request.lock().unwrap();
|
||||||
|
let is_greater = current_no > *last_request;
|
||||||
current_no - *last_request > SEALING_TIMEOUT_IN_BLOCKS
|
is_greater && current_no - *last_request > SEALING_TIMEOUT_IN_BLOCKS
|
||||||
};
|
};
|
||||||
|
|
||||||
if should_disable_sealing {
|
if should_disable_sealing {
|
||||||
|
Loading…
Reference in New Issue
Block a user