Skip to main content
. 2025 Feb 8;25(4):1003. doi: 10.3390/s25041003
Algorithm 2: The cross-block conflict resolution algorithm
Input: Transaction blocks to be verified broadcasted by other nodes
Output: Legal transaction blocks
1: The transaction blocks that are to be verified and that have been received over a period of time are entered into set B.
2: for (transaction block iB) do
3:  Check if transactions within i are legal//The same method as Bitcoin transaction checking.
4:   Check if transactions within i already exist in another transaction block.//Avoiding repeat transactions.
5:  Check if the difficulty of the feature-to-transaction correspondence within i is higher than or equal to the mining difficulty.//Avoiding reducing block security
6:  Remove transaction blocks that do not pass 3–5 from B, indicating that they have been discarded.
7: end for
8: Find conflicting transaction block B’ with the same parent block hash from B.
9: for (transaction block iB’) do
10:  Check if the parent block is stored locally.//When the local block is incomplete, it may appear that the parent block is not found.
11:  if (it is not) then
12:   Request the parent block from neighboring nodes, remove i from B’ and store it locally for later verification.
13:  end if
14:  Count the computing power, transaction fees, timestamps of the transaction blocks that conflict with i.
15:  Determine the unique transaction block i’ based on the principle of large computing power first, high transaction fee second, and early timestamp last.//Ensuring that the block is secure while protecting the benefits of the nodes as much as possible.
16: end for
17: return i