Research Article
Blockchain-Empowered High-Frequency Spectrum Management IoT: A Multilayer PBFT Consensus Perspective
Algorithm 2
Two-layer PBFT consensus:
. while valid pre-prepare1 received=True do | multicasts prepare1 to | end while | while valid prepare1 received=True do | if number of valid prepare1≥2fthen | prepare1=valid | multicasts commit1 to | end if | end while | while valid commit1 received=True do | if number of valid commit1≥2fthen | commit1=valid | multicasts sub-pre-prepare2 to | end if | end while | while valid sub-prepare2 received=True do | if number of valid sub-prepare2≥2fthen | sub-prepare2=valid | reply primary with reply1 | end if | end while | while valid sub-commit2 received=True do | if number of valid sub-commit2≥ 2f then | reply client with reply1 | end if | end while |
|