mirror of
https://github.com/SChernykh/p2pool.git
synced 2025-01-22 02:14:30 +00:00
SideChain: fixed potential division by 0
This commit is contained in:
parent
70f78ebfd1
commit
8876af53d8
1 changed files with 1 additions and 1 deletions
|
@ -890,7 +890,7 @@ void SideChain::print_status(bool obtain_sidechain_lock) const
|
|||
|
||||
// "block_depth <= window_size - 1" here (see the check below), so window_index will be <= N - 1
|
||||
// This will map the range [0, window_size - 1] into [0, N - 1]
|
||||
const size_t window_index = block_depth * (N - 1) / (window_size - 1);
|
||||
const size_t window_index = (window_size > 1) ? (block_depth * (N - 1) / (window_size - 1)) : 0;
|
||||
|
||||
if (cur->m_minerWallet == w) {
|
||||
++our_blocks_in_window[window_index];
|
||||
|
|
Loading…
Reference in a new issue