Commit graph

1597 commits

Author SHA1 Message Date
Jonathan Gillham
968b6da5db Changed TxIn.PreviousOutpoint to TxIn.PreviousOutPoint after btcwire API change. 2014-10-01 13:52:19 +01:00
Jonathan Gillham
ccee51a0be Changed TxIn.PreviousOutpoint to TxIn.PreviousOutPoint for consistency. 2014-10-01 13:43:37 +01:00
Dave Collins
02647404fa Prepare for release 0.9.0. 2014-09-20 13:00:02 -05:00
Dave Collins
8733b9c8df Bump default user agent to 0.2.0. 2014-09-20 12:45:18 -05:00
Dave Collins
2a688a70b2 Update ldb tests for latest API error changes. 2014-09-20 00:47:20 -05:00
David Hill
4ad8622af9 Remove transactions from orphan pool.
This change removes transactions from a newly connected block
from the orphan pool if they exist.  Additionally, any orphan
transactions that are no longer orphan transactions are moved
to the mempool and inv'd to the currently connected peers.
2014-09-19 22:58:06 -05:00
Dave Collins
7452e51976 Update sample config file.
This commit adds a couple of options which were not details in the sample
config file.  It also fixes a couple of typos and makes the example default
maxpeers setting in the config file match the actual default used in btcd.
2014-09-18 15:28:39 -05:00
David Hill
efcf90d83d Use Warnf when processing directives. 2014-09-17 09:37:37 -04:00
John C. Vernaleo
d6945f94e6 Fix tests. 2014-09-16 15:13:31 -04:00
John C. Vernaleo
2480cb3a87 Match error names to btcdb updates. 2014-09-16 15:09:32 -04:00
John C. Vernaleo
f5f03e8172 Match error names to btcdb updates. 2014-09-16 15:08:53 -04:00
John C. Vernaleo
a7ac93f5b6 Error improvements for lint.
Rename errors to Err*.
Lowercase error text.

Add golint for top level package

ok @davecgh
2014-09-16 15:07:11 -04:00
John C. Vernaleo
372bbe5c49 Add vet and lint where possible to travis. 2014-09-16 11:31:51 -04:00
John C. Vernaleo
68d10f4dc8 Add some missing comments.
ok @davecgh
2014-09-16 11:23:49 -04:00
John C. Vernaleo
351a2a5f5e Add vet, lint, and 1.2 builds to travis. 2014-09-16 08:21:34 -04:00
Josh Rickmar
0127b3aafe Make ErrHashStrSize slightly more descriptive.
Add the word 'string' to the error string so if this is printed, it
will be clearer that it was a hash string decode that failed (as
opposed to other errors creating a ShaHash from a byte slice) and
change 'chars' to 'bytes', since the string length is measured in
bytes, not UTF-8 code points.

ok @davecgh
2014-09-12 08:44:15 -05:00
David Hill
41fbb87c86 Reject transactions with too many signature operations.
This matches recent changes in bitcoin core.
2014-09-10 19:28:03 -05:00
Olaoluwa Osuntokun
b97083f882 Fix some typos throughout repo. 2014-09-08 14:54:52 -05:00
Josh Rickmar
790f652d06 btcctl: Fix createrawtransaction amounts.
These were being counted in satoshis, when the JSON object should be
containing JSON numbers, counted in BTC.
2014-09-08 11:57:57 -05:00
Dave Collins
225248d283 Use byte literals in tests to make go vet happy.
The go vet command complains about untagged struct initializers when
defining a ShaHash directly.  This seems to be a limitation where go vet
does not exclude the warning for types which are a constant size byte array
like it does for normal constant size byte array definition.

This commit simply modifies the tests to use a constant definition cast to a
ShaHash to overcome the limitation of go vet.
2014-09-05 13:58:40 -05:00
Dave Collins
cf4f19dd4c Make btcctl errcheck clean.
This commit explicitly ignores errors that were already intentionally
ignored in btcctl by using an _ to make the errcheck utility happy.  It is
also nice to make it explicit that the error is being ignored
intentionally rather than leave questions of whether it was accidentally
forgotten.
2014-08-31 18:14:15 -05:00
David Hill
a429bebbba Pass the correct types for signrawtransaction. 2014-08-31 17:37:49 -05:00
David Hill
9cecf1dc2e Use the new bloom Reload API.
This fixes a race caught by the go race detector.
ok @jrick
2014-08-30 12:14:56 -04:00
David Hill
2803ea17c2 Remove the use of go-spew. 2014-08-29 16:06:17 -04:00
David Hill
8f375ba391 Add getnetworkinfo support to btcctl.
ok @jrick
2014-08-29 09:39:37 -04:00
David Hill
8774a77d33 Use Errorf when using formatting directives.
Found by go vet.
2014-08-28 11:49:49 -04:00
David Hill
c3abafc7eb Println -> Printf when using formatting directives.
This makes go vet happy.
2014-08-28 10:23:46 -04:00
David Hill
8f748615d4 Add testnet3 dnsseed testnet-seed.bitcoin.schildbach.de 2014-08-26 20:41:36 -04:00
Jonathan Gillham
516db23576 Replaced privkey in entire codebase. 2014-08-25 21:14:19 +01:00
Jonathan Gillham
da080e1598 Changed privkey to privKey for consistency. 2014-08-25 21:09:23 +01:00
ortutay
139d9cb447 Implement verifymessage RPC. 2014-08-22 16:58:02 -07:00
David Hill
6793bb23ac Display JSON when using btcctl's signrawtransaction. 2014-08-20 11:32:17 -04:00
David Hill
6d739c5a9e Add signrawtransaction to btcctl. 2014-08-20 11:27:27 -04:00
Dave Collins
ca13333d25 Always show help on help flag.
This commit resolves a minor issue where an error in the config file would
prevent the help from being shown until the config file error was
resolved.

This results in the following behavior:

- With a malformed header:
  $ ./btcd
  Error parsing config file: ~/btcd/btcd.conf:14: malformed section header
  Use btcd -h to show usage
- With an invalid option:
  $ ./btcd
  Error parsing config file: unknown option: bogus
  Use btcd -h to show usage
- Invoking help with an error in the config file:
  $ ./btcd -h
  Usage:
  ...
- Invoking with an invalid command line option:
  $ ./btcd --bogus=bogus
  unknown flag `bogus'
  Use btcd -h to show usage

ok @jrick
2014-08-19 20:29:59 -05:00
Dave Collins
3dc3fefc9b Improve readability of recent rate limiter changes.
This commit builds on the recent limiter updates.  The recent changes
introduced a new function named calcTxFee which could easily be confused
with calculating the fees of the transaction rather than its intended
purpose of calculating the minimum transaciton relay fee.

Rather than taking that approach, this commit instead renames the existing
function to calcMinRequiredTxRelayFee and uses a consistent variable name
for the serialized size of a transaction.  It then moves the check for
whether or not the check should be applied based on the serialized size of
the transcation and block priority to the call site.

This approach also has the benefit of avoiding two calls to the
calculation function since it's a local at the call site.

ok @jrick, @dajohi
2014-08-19 11:39:30 -05:00
David Hill
61a53adccd Fix the mempool rate limiter.
Before, btcd was rate limiting all transactions that had a minimum
fee of zero.  Now, btcd only rate limits transactions that contain
a fee less than the calculated fee based on size.

Closes #163
2014-08-19 10:22:22 -04:00
Dave Collins
95cd1b97fa Make the OP_FALSE constant untyped.
This makes it consistent with the rest of the opcode constants.
2014-08-13 00:32:16 -05:00
David Hill
e720e398a1 Mark getchaintips RPC command as unimplemented. 2014-08-12 11:33:07 -04:00
Dave Collins
74386998be Correct the addblock utility import.
This commit corrects the check in the addblock utility to check each block
links the previous hash as intended versus the current block.

Fixes #162.
2014-08-11 01:52:34 -05:00
Michalis Kargakis
6ae916bd37 More tests
Tests for IsPushOnlyScript, HasCanonicalPushes, and CalcMultiSigStats
2014-08-08 14:53:55 +03:00
Michalis Kargakis
55ad967b4d Complete SetLogWriter testing 2014-08-03 23:30:37 +03:00
David Hill
ef0ca7dff5 sync bitcoind script tests 2014-08-01 13:40:56 -04:00
Michalis Kargakis
24c3873956 Add log testing
8/10 of SetLogWriter tested
2014-07-31 23:42:09 +03:00
Guilherme Salgado
ece3ed8443 Incrementally backoff when reconnecting to peers
This ensures we backoff when reconnecting to peers for which we don't
understand the replies, just like we do for peers we fail to connect to.

Closes #103
2014-07-25 14:05:56 -05:00
Dale Rahn
f373ba3583 Introduce new error to indicate that block is not found vs db error.
ok @davecgh
2014-07-25 13:55:20 -05:00
Josh Rickmar
8e74343747 Detect chain reorgs that happen during a rescan.
While here, switch rescan method to use hashes, not heights, to refer
to starting and ending blocks.

Closes #151.

ok @davecgh
2014-07-25 13:21:03 -05:00
Josh Rickmar
da993eb034 Fix sending of next item in notification queue.
The notification queue used for websocket client notifications had a
bug which caused the next queued item in some situations to not be
sent, but instead send a previously sent item.  This change fixes this
by setting the 'next' variable to the next item which must be
dequeued, if the queue length is non-zero.

This bug did not always manifest itself as if the receiving goroutine
was ready, a queued item could be sent directly to it rather than
waiting in the queue to be sent at a later time.
2014-07-25 08:20:58 -05:00
Josh Rickmar
790a4f5a6e Return nil for some spent gettxout outputs.
This change modifies the behavior of the gettxout RPC to match the
behavior of the reference client.  If a transaction output is spent by
a mined transaction, the handler will now return nil (JSON null).

While here, avoid indexing some slices multiple times, by creating a
local variable instead.
2014-07-24 15:02:07 -05:00
Dave Collins
764893c400 Ensure vars used atomically in peer are aligned.
The sync.atomic requires alignment of variables used atomically on ARM.
This commit moves the connected and disconnect variables in the peer
struct up so they are aligned.

Fixes #157.
2014-07-23 14:12:49 -05:00
Javed Khan
458a996ae6 updated utils to handle regtest, simnet
handle active network assignment in the same if-else
instead of having another switch-case
2014-07-22 08:28:33 -05:00