Branch: refs/heads/master
Home: https://github.com/conformal/btcutil
Commit: e402c62673d1ba09e36b631c7ded22942a219b8c
https://github.com/conformal/btcutil/commit/e402c62673d1ba09e36b631c7ded22942a219b8c
Author: Dave Collins <[email protected]>
Date: 2013-10-27 (Sun, 27 Oct 2013)
Changed paths:
M doc.go
A tx.go
Log Message:
-----------
Add new Tx wrapper for btcwire.MsgTx.
Currently, transaction hash caching is provided via Block directly, but a
transaction is not always part of a block and there are several cases
where only the transaction needs to be dealt with without wanting to pass
the entire block and transaction index around to be able to get at the
cached hash.
So, this commit adds a new type named Tx which is a wrapper that provides
easier and more efficient manipulation of raw wire protocol transactions.
It memoizes the hash for the transaction on its first access so subsequent
accesses don't have to repeat the relatively expensive hashing operations.
The idea is the callers can pass around pointers to these Tx types instead
of raw btcwire.MsgTx pointers.
For now, the Block API has not been changed, but the plan is to change it
to provide access to these wrapped transactions rather than having it do
the transaction hash caching directly.
This is only the first part of a series of changes working towards
optimizations noted in conformal/btcd#25.
Commit: 29f1bf4ae149fb71b6272ed3bf67e61e4b70f540
https://github.com/conformal/btcutil/commit/29f1bf4ae149fb71b6272ed3bf67e61e4b70f540
Author: Dave Collins <[email protected]>
Date: 2013-10-27 (Sun, 27 Oct 2013)
Changed paths:
M test_coverage.txt
A tx_test.go
Log Message:
-----------
Add tests for new Tx type.
This commit adds both positive and negative tests for the new Tx type to
bring its coverage to 100%.
This is part of the ongoing transaction hash optimization effort noted
in conformal/btcd#25.
Compare:
https://github.com/conformal/btcutil/compare/f72ab9cfcef8...29f1bf4ae149