Skip to main content
. 2019 Feb 25;19(4):970. doi: 10.3390/s19040970
Algorithm 1 Procedure of registering a node.
 1: Mapping map: blockchain.addressphysical.address;
 2: Mapping state: blockchain.address→0 or 1;
 3: while true do /* The contract is waiting for a contract caller to trigger */
Input: Contract Caller’s Blockchain Address ba; Contract Caller’s Physical Address pa;
Output: Registration Result r;
 4:   rnull;
 5:  if state(ba) = 1 then
 6:     rfailure;
 7:  else
 8:    map(ba) = pa;
 9:    state(ba) = 1;
 10:    rsuccess;
 11:  end if
 12: end while