Closed thesz closed 4 years ago
Cons:
RE 1: Transactions for block are selected from mempool and mempool checks transactions before accepting them anyway. So it could cache amount stored in inputs.
On this note. I played a bit with idea of writing transaction as:
data Tx i o = Tx
{ tx'inputs :: !(Vector i) -- ^ List of inputs
, tx'outputs :: !(Vector o) -- ^ List of outputs
}
This way we can use Tx InputRef Box
as on-wire transactions and keep Tx (Money,InputRef) Box
in mempool.
We are fetching boxes using BoxInputRef for validation purposes. We can check amounts at that moment.
I completely agree with the Tx i o
.
We need them in
We may check for correctness of money amount when fetching the box using BoxInputRef.