lbcutil/txsort
Dave Collins 22c91fa80a Update for recent chainhash-related API changes. (#78)
This updates all code in the main package and subpackages to make use of
the new chainhash package since the old wire.ShaHash type and functions
have been removed in favor of the abstracted package.

Also, since this required API changes anyways and the hash algorithm is
no longer tied specifically to SHA, all other functions throughout the
code base which had "Sha" in their name have been changed to Hash so
they are not incorrectly implying the hash algorithm.

The following is an overview of the changes:

- Update all references to wire.ShaHash to the new chainhash.Hash type
- Rename the following functions and update all references:
  - Block.Sha -> Hash
  - Block.TxSha -> TxHash
  - Tx.Sha -> Hash
  - bloom.Filter.AddShaHash -> AddHash
- Rename all variables that included sha in their name to include hash
  instead
- Add license headers to coinset package files
2016-08-08 12:38:16 -05:00
..
testdata txsort: Update package for BIP0069 acceptance. 2016-03-22 12:49:35 -07:00
doc.go txsort: Update package for BIP0069 acceptance. 2016-03-22 12:49:35 -07:00
README.md txsort: Update package for BIP0069 acceptance. 2016-03-22 12:49:35 -07:00
txsort.go Update for recent chainhash-related API changes. (#78) 2016-08-08 12:38:16 -05:00
txsort_test.go Update for recent chainhash-related API changes. (#78) 2016-08-08 12:38:16 -05:00

txsort

[Build Status] (https://travis-ci.org/btcsuite/btcutil) ![ISC License] (http://img.shields.io/badge/license-ISC-blue.svg) [GoDoc] (http://godoc.org/github.com/btcsuite/btcutil/txsort)

Package txsort provides the transaction sorting according to BIP 69.

BIP 69 defines a standard lexicographical sort order of transaction inputs and outputs. This is useful to standardize transactions for faster multi-party agreement as well as preventing information leaks in a single-party use case.

The BIP goes into more detail, but for a quick and simplistic overview, the order for inputs is defined as first sorting on the previous output hash and then on the index as a tie breaker. The order for outputs is defined as first sorting on the amount and then on the raw public key script bytes as a tie breaker.

A comprehensive suite of tests is provided to ensure proper functionality.

Installation and Updating

$ go get -u github.com/btcsuite/btcutil/txsort

License

Package txsort is licensed under the copyfree ISC License.