Commit graph

15 commits

Author SHA1 Message Date
Dave Collins
6b18796af7 Add 2014 to copyright dates. 2014-01-08 23:54:52 -06:00
Dave Collins
1f87ee217a Move testdata to root btcd directory.
Rather than duplicating the same data, just put it under testsdata at the
root and access it from the modules from the parent directory.
2013-10-12 01:49:57 -05:00
Dale Rahn
cda0b10082 Introduce an API change for btcdb
FetchTxBySha changes what it returns, it can now return a TxListReply and
and error if none are found.

FetchTxByShaList is renamed to FetchUnSpentTxByShaList to indicate that
it will (likey/eventually) only return Tx that have some unspent TxOuts.
Tx which are fully spent may not be (reliably) looked up using this API.
2013-10-03 16:51:34 -04:00
Dale Rahn
63f8993163 Delete testing operations from obsolete functions. 2013-10-02 18:10:00 -04:00
Dale Rahn
b4c6a5b8ab fmt 2013-08-22 09:32:23 -04:00
Owain G. Ainsworth
840708a3e7 Fix up some format strings to appease go vet.
Extra argument present when no format directive for it (and not needed,
either).
2013-08-06 18:00:47 +01:00
Dave Collins
8062889d04 Update for latest btcutil and btcwire changes.
This commit updates the calls into btcutil and btcwire for the latest API
changes which remove the need for the protocol version for serialization
and deserialization of blocks and transactions.
2013-08-05 18:28:17 -05:00
Dale Rahn
ead14e5a12 Testing code for FetchHeightRange() 2013-08-01 16:14:22 -04:00
Dale Rahn
b46d53c18e Test NewestSha() 2013-08-01 15:03:26 -04:00
Dave Collins
25684a2ccb Don't add a genesis block by default.
This commit modifies the way initial database creation is handled.

Previously, the genesis for the main chain was inserted automatically upon
creation of the database.  However, that approach caused an issue since
other networks such as the test network don't use the same genesis block
as the main network.

The new approach introduced by this commit is to leave it up to the caller
to insert the desired genesis block.  In order to support this, the
InsertBlock function has been modified to allow the first (and only the
first) block to be inserted without having an existing parent.  Also, the
NewestSha function has been modified to return a zero hash, -1 for the
height, and no error when the database does not yet have any blocks.  This
allows the caller to determine the difference between no blocks and only
the genesis block (in which case the return values would be the genesis
hash and 0 for the height).
2013-07-29 11:48:10 -05:00
Dale Rahn
66731c1a1e Implement TxOut Spend tracking.
Return spent data in TxListReply.

Unspend coins when blocks are removed during DropAfterBlock.
2013-07-18 18:11:37 -04:00
Owain G. Ainsworth
a7a9023bc1 Add ExistsTxSha to db interface.
This function may be used to check for existance of a tx sha without having to
fetch the data from the db.
2013-07-10 00:11:02 +01:00
Dave Collins
e30ceb5947 Cleanup and fix operational tests.
This commit makes several changes to the operation tests as follows:

- Ensure the database is closed between each operational mode test as
  otherwise  the database is locked when trying to reopening it which
  makes it unusable
- Make the insert tests error after a single failure since every test
  afterwards is guaranteed to fail as well
- Remove some of the logging statements which cluttered up the failed test
  prints making it harder to see why a given test failed
- Make a couple of the log messages more descriptive
2013-05-29 16:11:13 -05:00
Dave Collins
1846307821 Use correct import path in btcdb tests. 2013-05-29 14:48:18 -05:00
Dave Collins
752ca5dfbb Initial implementation. 2013-05-29 10:09:26 -05:00