]> git.bitcoin.ninja Git - rust-lightning/commit
[RFC][Tx Sort] Implement sorting of inputs
authorSavil Srivastava <savil@cs.stanford.edu>
Mon, 23 Jul 2018 00:03:13 +0000 (17:03 -0700)
committerSavil Srivastava <savil@cs.stanford.edu>
Tue, 24 Jul 2018 03:26:26 +0000 (20:26 -0700)
commiteb1eddcea0e3591e4065806a3951d791745ec6cd
treedd7be90987f01b84b35ac4f8ecccdce99558377e
parent89167164da5e507cc49ca78489ccc7629508102b
[RFC][Tx Sort] Implement sorting of inputs

Follows BIP69: https://github.com/bitcoin/bips/blob/master/bip-0069.mediawiki

1. Implements sorting of transactoin inputs.
- BIP says to use "reversed byte-order" for the `prev_hash`. I interpreted this as: little-endian.
- TODO need to add tests

2. Re: improve sorting of TxOut's script_pubkey to use lexicographic ordering, and not length.
From the test-cases i've included it seems that the current code already does lexicographic ordering (and not length based). Am i missing something?
src/util/transaction_utils.rs