Commit graph

3486 commits

Author SHA1 Message Date
Dave Collins
acda2044a0 Add godoc reference badge to README.md. 2014-06-12 18:40:44 -05:00
Dave Collins
3cbba55822 Add support for TravisCI.
Also add TravisCI build status badge to README.md.
2014-06-12 18:37:35 -05:00
Dave Collins
0f23236f43 Make subsidy halving interval for simnet 210000.
This value matches testnet and mainnet and makes more sense because it
allows way more coins to be generated which is useful during simulation
testing.

NOTE: this will invalidate existing simnet chains, but since they
are only intended to be short lived for the duration of a simulation test,
this is a non-issue.
2014-06-12 18:20:51 -05:00
Dave Collins
c71988f668 Add comments for prefixes the encoding IDs map to. 2014-06-12 18:14:46 -05:00
GeertJohan
a3091847b3 Fix adding wrong HashAddrID to pubKeyHashAddrIDs 2014-06-13 01:00:59 +02:00
John C. Vernaleo
6a69acef21 Fix typo. 2014-06-12 15:41:57 -04:00
John C. Vernaleo
cd3d832551 Switch pingtime and pingwait to float64.
Needed to match bitcoin-core and btcjson.

ok @davec
2014-06-12 15:39:20 -04:00
John C. Vernaleo
3d7749fcea Change PingTime and PingWait to float64.
This is to match bitcoin-core.  Caught by Skelsey.

Closes #24
2014-06-12 15:36:57 -04:00
Dave Collins
ac5cc1d64e Use default genproclimit of -1 on setgenerate RPC.
The correct default for the genproclimit on the setgenerate RPC is -1.

ok @jcvernaleo.
2014-06-12 14:23:38 -05:00
David Hill
e9211bd01a Fix log message. 2014-06-12 14:04:05 -04:00
Josh Rickmar
28c0a3c8c7 Modify doco and example for btcwallet ws endpoint. 2014-06-12 13:00:42 -05:00
Dave Collins
eee338cbe3 Update mining-related RPC handlers for new code.
Now that btcd support CPU mining, update the getgenerate, setgenerate,
gethashespersec, and getmininginfo RPC handlers to return the appropriate
information.

Also, remove the various extra help addenda about btcd not supporting
mining since it is no longer true.
2014-06-12 12:06:26 -05:00
Dave Collins
e25b644d3b Implement a built-in concurrent CPU miner.
This commit implements a built-in concurrent CPU miner that can be enabled
with the combination of the --generate and --miningaddr options.  The
--blockminsize, --blockmaxsize, and --blockprioritysize configuration
options wich already existed prior to this commit control the block
template generation and hence affect blocks mined via the new CPU miner.

The following is a quick overview of the changes and design:

- Starting btcd with --generate and no addresses specified via
  --miningaddr will give an error and exit immediately
- Makes use of multiple worker goroutines which independently create block
  templates, solve them, and submit the solved blocks
- The default number of worker threads are based on the number of
  processor cores in the system and can be dynamically changed at
  run-time
- There is a separate speed monitor goroutine used to collate periodic
  updates from the workers to calculate overall hashing speed
- The current mining state, number of workers, and hashes per second can
  be queried
- Updated sample-btcd.conf file has been updated to include the coin
  generation (mining) settings
- Updated doc.go for the new command line options

In addition the old --getworkkey option is now deprecated in favor of the
new --miningaddr option.  This was changed for a few reasons:

- There is no reason to have a separate list of keys for getwork and CPU
  mining
- getwork is deprecated and will be going away in the future so that means
  the --getworkkey flag will also be going away
- Having the work 'key' in the option can be confused with wanting a
  private key while --miningaddr make it a little more clear it is an
  address that is required

Closes #137.

Reviewed by @jrick.
2014-06-12 12:05:32 -05:00
Josh Rickmar
4ac778d72a Do not reissue rescan requests on reconnect. 2014-06-12 11:38:22 -05:00
David Hill
8ce9c21148 Add new testnet seed testnet-seed.alexykot.me 2014-06-12 11:55:43 -04:00
Dave Collins
f0c05c76d3 Add getmininginfo to btcctl. 2014-06-11 22:41:22 -05:00
Dave Collins
c379061d6f Correct comment type for newInboundPeer. 2014-06-11 20:14:10 -05:00
Josh Rickmar
cfb46e2c43 Add getinfo support. 2014-06-11 16:38:54 -05:00
Josh Rickmar
1ec6dde39c Add custom/raw request/response support. 2014-06-11 16:38:54 -05:00
Josh Rickmar
793e66c785 Add callback for connects and reconnects. 2014-06-11 16:38:54 -05:00
Josh Rickmar
5a01ac2ed8 Update test coverage report. 2014-06-11 12:05:15 -05:00
Josh Rickmar
b873e70c95 Remove SetId. 2014-06-11 12:04:51 -05:00
Josh Rickmar
93f5aab0db Update test coverage report. 2014-06-11 12:02:35 -05:00
Josh Rickmar
65c0570234 Remove SetId from Cmd interface. 2014-06-11 12:01:05 -05:00
David Hill
f67358d4db Add estimatefee and estimatepriority to btcctl. 2014-06-11 11:12:27 -04:00
David Hill
39b09f7be1 Add support for estimatefee and estimatepriority. 2014-06-11 11:05:13 -04:00
David Hill
a992b48705 Add missing rpc commands and mark as unimplemented. 2014-06-11 10:46:19 -04:00
John C. Vernaleo
92c7716dd4 Update coverage report. 2014-06-10 16:29:56 -04:00
Nicola 'tekNico' Larosa
1723db03c5 Add type and handling for listreceivedbyaddress. 2014-06-10 16:25:53 -04:00
Brian Deery
ddc773535a Remove comments interpreted as settings
in go-flags/ini_private.go in function readIni there is no mechanism for
adding inline comments.  Only comments that have a semicolon as the first
non-whitespace character are ignored.

According to Wikipedia http://en.wikipedia.org/wiki/INI_file#Comments
inline comments are not universally supported.

This change adds some white space for readability, but
name := strings.TrimSpace(line[1 : len(line)-1]) removes accidental whitespace
left in later.

Closes #135.
2014-06-09 14:36:07 -05:00
Dave Collins
cc3e49fabb Make loadConfig function name a variable.
The errors in the loadConfig function had the function name hardcoded in
each error.  This commit assigns the function name to a variable instead.
2014-06-07 14:42:54 -05:00
Dave Collins
3266bf6a8d Convert to use gorilla websockets package.
Also, since the new websoscket package allows the message type to be set
independently from the type of the variable, remove the casts between
strings and []byte in the websocket read/write paths.  This avoids extra
copies thereby reducing the garbage generated.

Closes #134.
2014-06-07 01:34:33 -05:00
Dave Collins
8e624b20a9 Switch to conformal vendoring of Gorilla websocket. 2014-06-07 01:06:11 -05:00
Josh Rickmar
7dcb68275f Make MaxMessagePayload an exported constant.
ok @davecgh
2014-06-06 22:33:39 -05:00
Dave Collins
1602463681 Don't split up the group for debuglevel functions. 2014-06-05 23:57:05 -05:00
Dave Collins
7eea8252a4 Add the new example to README.md and doc.go. 2014-06-05 20:58:47 -05:00
Dave Collins
cd4018b33e Add btcwallet websocket example.
Reviewed by @jrick who also provided some comment and terminology
improvements.
2014-06-05 20:40:45 -05:00
David Hill
bf48a97b0d Use NewReader instead of NewBuffer.
NewReader is slightly faster, but more importantly, ensures that the
data is read-only.
2014-06-05 14:00:22 -04:00
David Hill
8bce0ef3f8 Convert binary Write()'s to PutUint64()'s.
PutUint64 is faster than a generic binary write, and also removes
the 'bytes' package from the import list.
2014-06-05 14:00:22 -04:00
David Hill
66afd1dbc9 Use NewReader instead of NewBuffer. 2014-06-05 13:52:37 -04:00
Michalis Kargakis
e31398a272 Add height parameter in disconn notification 2014-06-05 20:48:56 +03:00
Dave Collins
ee46a0b108 Use bytes.NewReader for deserialize when possible.
Rather than using bytes.NewBuffer, which is a read/write entity
(io.ReadWriter), use bytes.NewReader which is only a read entitiy
(io.Reader) in all cases where it is possible.  Benchmarking shows it's
slightly faster and it's also technically more accurate since it ensures
the data is read-only.

There are a few cases where bytes.NewBuffer must still be used since a
buffer with a known length is required for those instances.
2014-06-04 23:39:03 -05:00
Dave Collins
4e8e63e0d7 Use bytes.NewReader for all deserialization.
Rather than using bytes.NewBuffer, which is a read/write entity
(io.ReadWriter), use bytes.NewReader which is only a read entitiy
(io.Reader).  Benchmarking shows it's slightly faster and it's also
technically more accurate since it ensures the data is read-only.
2014-06-04 22:12:47 -05:00
David Hill
7f825fd9bc Remove unneeded usage of fmt.Sprintf 2014-06-04 20:24:48 -04:00
David Hill
0acd038eb6 Use the correct network block for he.net. 2014-06-04 19:11:47 -04:00
Dave Collins
c673d76979 Fix case where block mgr could hang on shutdown.
This commit resolves an issue where it was possible the block manager
could hang on shutdown due to inventory rebroadcasting.  In particular, it
adds checks to prevent modification of the of rebroadcast inventory during
shutdown and adds a drain on the channel to ensure any outstanding
messages are discarded.

Found by @dajohi who also provided some of the code.
2014-06-02 16:15:24 -05:00
Dave Collins
2054fa7581 Update doc.go to reflect reality.
This commit updates doc.go to include the new simulation test network
magic constant as well as remove the information about BIP0037 not being
supported since that is no longer true.
2014-06-02 12:35:00 -05:00
Dave Collins
879a125a2f Update CONTRIBUTORS. 2014-06-02 09:50:03 -05:00
kargakis
a785ef6424 minor syntax fixes 2014-06-02 17:31:02 +03:00
Dave Collins
468f8366cf Make multisig txns with non-null dummy nonstandard.
This commit helps prevent transaction malleability by enforcing that the
extra dummy value on multisig transaction script contains no data for a
transaction .  This syncs with a recent change in Bitcoin Core to remain
compatible.

As part of this change a new constant has been introduced which is used to
specify the script flags which are used for standard transactions.  This
constant is then used in both the memory pool and the mining code to
ensure they remain in sync with one another.

Closes #131.

ok @jrick, @dajohi
2014-05-31 11:56:58 -05:00