Commit graph

6 commits

Author SHA1 Message Date
Dave Collins
09b53a8fca Export the CheckBlockSanity function. 2013-11-07 15:39:48 -06:00
Dave Collins
6165e9b95b Convert API to use new btcutil.Tx.
This is part of the ongoing transaction hash optimization effort noted in
conformal/btcd#25.
2013-10-28 15:17:53 -05:00
Dave Collins
0b334bc841 Correct reading of serialized height in coinbase.
This commit corrects the reading of the serialized height in coinbase
transactions for block height of version 2 or greater.  On mainnet, the
serialized height is always 3 bytes and will continue to be so for
something like  another ~159 years, so there was no issue with mainnet.
However on testnet, there are some version 2 blocks which are low enough
in the chain to only take 2 bytes to serialize.

In addition, this commit adds a full tests for the relavant function
including negative tests and variable length serialized lengths for block
heights.

Closes #1.
2013-10-06 14:27:53 -05:00
Dave Collins
f219ed5baf Add support for params based on active network.
This commit modifies the code to use params based on the active network
which paves the way for supporting the special rules and different genesis
blocks used by the test networks.
2013-07-24 12:26:17 -05:00
Dave Collins
20f7c2ecd0 Add tests for TimeSorter. 2013-07-19 12:49:11 -05:00
Dave Collins
aa5847f3cc Initial implementation. 2013-07-19 08:50:13 -05:00