Research Article

MPoR: A Modified Consensus for Blockchain-Based Internet of Vehicles

Algorithm 1

Stochastic filtering.
Input: List of vehicles , Percentage parameter
Output: List of vehicles after stochastic filtering
1: Calculate average timestamp from Equation (2)
2: Calculate target hash from Equation (3)
3: fordo
4: Calculate hash of :
  
5: Calculate absolute difference value between
  Targethash and HashVi
6: Add in list
7: end for
8: Sort Labs in ascending order
9: fordo
10: Add into
11: end for
12: Broadcast chosen result
13: return List