The block transactions are loaded only when they are required, this
is specially useful while synchronizing bitcoin because it reduces
the workload to the bitcoind on the initial sync.
- A TPoS contract is created when the transaction is synchronized.
- A TPoS contract is deleted when the transaction is rolled back.
- A TPoS contract is closed when the collateral output is spent.
- A TPoS contract is enabled when the collateral output gets unspent.
Instead of failing to load a batch of transactions, we try to load
them sequencially to avoid overloading the RPC API.
This allows a smoother synchronization process.
This is a simplified version of the BlockEventProcessor, it handles
the synchronization between the xsn and our ledger database, it also
takes care of a lot of corner cases to keep the synchronization process
flexible enough and linear.