Skip to main content
. 2020 Sep 16;20(18):5297. doi: 10.3390/s20185297
Algorithm 2 Algorithm for Consensus.
Input: set of management node: D, the number of management node: N, fixed time: T, current time: t
Output: selected management node ID: SN
  • 1:

    iftT=0then

  • 2:

     Random(D) ← random arrangement D.

  • 3:

     D’ ← Random(D).

  • 4:

     while Select node sequentially from set D’ do

  • 5:

      let SN ← D’.

  • 6:

      if SN can generate blocks then

  • 7:

       return SN

  • 8:

      else

  • 9:

       continue.

  • 10:

      end if

  • 11:

     end while

  • 12:

     Let SN generate Block.

  • 13:

    end if