message: prevent panic when blocks_per_cycle=0
diff: @@ -17,13 +17,23 @@ macro_rules! merge_slices {
  // cycle in which is given level
  // level 0 (genesis block) is not part of any cycle (cycle 0 starts at level 1), hence the -1
  pub fn cycle_from_level(level: i32, blocks_per_cycle: i32) -> i32 {
  + if blocks_per_cycle == 0 {
  + (level - 1) / 2048
  + } else {
  (level - 1) / blocks_per_cycle
  }
  +}
  // the position of the block in its cycle
  // level 0 (genesis block) is not part of any cycle (cycle 0 starts at level 1)
  // hence the blocks_per_cycle - 1 for last cycle block
  pub fn level_position(level:i32, blocks_per_cycle:i32) -> i32 {
  + // set defaut blocks_per_cycle in case that 0 is given as parameter
  + let blocks_per_cycle = if blocks_per_cycle == 0 {
  + 2048
  + } else {
  + blocks_per_cycle
  + };
  let cycle_position = (level % blocks_per_cycle) - 1;
  if cycle_position < 0 { //for last block
  blocks_per_cycle - 1
  