Add HasBlockHeight and HasInputPrevOuts traits#75
Add HasBlockHeight and HasInputPrevOuts traits#75bc1cindy wants to merge 1 commit intopayjoin:masterfrom
Conversation
51208ff to
e633614
Compare
I commented here by mistake, it should have been on another PR |
arminsabouri
left a comment
There was a problem hiding this comment.
Quick pass thru. The thing that would be the most useful for review is to understand why you need these methods? How does your classifier work?
| } | ||
|
|
||
| impl<'a> HasInputPrevOuts for TxHandle<'a> { | ||
| fn input_prev_types(&self) -> Vec<Option<OutputType>> { |
There was a problem hiding this comment.
When would this be optional?
There was a problem hiding this comment.
coinbase and prev tx not in the index
makes sense?
| self.map_input_prev_outs(|p| p.output_type()) | ||
| } | ||
|
|
||
| fn input_prev_script_hashes(&self) -> Vec<Option<ScriptPubkeyHash>> { |
the detector classifies txs into
for loose txs (no block height), we can't compute the window, so we accept any block-height-style locktime, the other Modern gates keep precision without these traits the cohesion + locktime checks can't be expressed without bloating |
Coinjoin heuristics need a tx's confirmed block height and each input's prev-out script type and hash. AbstractTransaction exposes neither. AbstractTxIn now also requires HasSequence so per-input sequence is uniformly available. Loose storage's input_sequence panic stub is replaced with the real impl.
e633614 to
3244e2c
Compare
Coinjoin heuristics need a tx's confirmed block height and each
input's prev-out script type and hash. AbstractTransaction
exposes neither.
AbstractTxIn now also requires HasSequence so per-input sequence
is uniformly available. Loose storage's input_sequence panic
stub is replaced with the real impl.
Part of #5.