hexresearch / hschain

Other
4 stars 0 forks source link

Sz/better block generation #647

Closed thesz closed 4 years ago

thesz commented 4 years ago

The problem is that operation on consensus state (which includes blockchain state with the mempool state) must be pure. And in some contexts generation of reward transactions must be in IO.

Thus, interface to invent a block to mine was changed to two functions: pure function to obtain a good header and list of transactions to include into block and IO action to create a block from header and list of transactions, including the aforementioned reward transaction.

That's all.