Commit graph

9 commits

Author SHA1 Message Date
Dave Collins
4edc4ceb9e Update for recent btcwire API changes. 2014-01-18 20:59:07 -06:00
Dave Collins
2af3c8263a Add 2014 to copyright dates. 2014-01-08 23:46:05 -06:00
Dave Collins
8e97f32e68 Add funcs to Block API for wrapped transactions.
This commit adds two new functions to the Block API for working with the
recently added Tx type from the Block.

These new functions are named Tx and Transactions.  Tx returns a
transactions for the specified index as a Tx and also memoizes it so
subsequent calls are more efficient.  Transactions returns a slice of all
transactions in the Block wrapped in a Tx.

This is part of the ongoing transaction hash optimization effort
noted in conformal/btcd#25.
2013-10-28 10:34:27 -05:00
Dave Collins
43095c66bc Remove dependency on protocol version.
This commit unfortunately changes the public API of Block which I
ordinarily don't like to do, but in this case, I felt it was necessary.

The blocks used throughout the database and elsewhere should be indepedent
of the protocol version which is used to encode the block to wire format.
Each block has its own Version field which should be the deciding factor
for the serialization and deserialization of blocks.  In practice, they
are currently the same encoding, but that may not always be the case, and
it's important the blocks are stable depending on their own version
regardless of the protocol version.

This makes use of the new Serialize and Deserialize functions on MsgBlock
which are intended for long-term storage as opposed to wire encoding.
2013-08-05 16:28:55 -05:00
Dave Collins
b8843a0fb6 Make TxLoc comment consistent with others. 2013-05-30 11:39:43 -05:00
Dave Collins
e98dc50b69 Convert TxLoc to use normal returns. 2013-05-30 11:31:22 -05:00
Dave Collins
969fbd1500 Cleanup TxLoc function variable names. 2013-05-30 11:13:08 -05:00
Dave Collins
af89ed1c2e Correct documentation of the Block.TxLoc function. 2013-05-28 18:43:13 -05:00
Dave Collins
ef6c01960f Initial implementation. 2013-05-28 18:21:26 -05:00