Skip to main content
. 2023 Oct 27;23(21):8762. doi: 10.3390/s23218762
Algorithm 2 Expired data traversing procedure
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
Input:  chain → chain of blocks
             mempool → new transactions to be added in a new block
Output: mempool → updated list of transactions

Procedure

         for i = 0; i < chain.length(); i++ do
                block ← chain.get(i)

                    for j = 0; j < block.data.length(); j++ do
                          tx ← block.data.get(j)

                        if block.timestamp + tx.expire >= date.now() then
                              tx.status ← 0x00…00
                              tx.expire ← NULL
                              tx.data ← NULL
                              mempool.add(tx)

        return mempool