Commit graph

2515 commits

Author SHA1 Message Date
Josh Rickmar
6325bd9df2 Update test coverage file. 2013-11-27 19:30:13 -05:00
Josh Rickmar
708dce8d99 Fix sendmany optarg parsing and add tests. 2013-11-27 19:27:46 -05:00
David Hill
9e57a6c5be add --notls option to disable connecting with TLS
ok oga@
2013-11-26 20:13:31 -05:00
David Hill
295cc873f4 add getbalance 2013-11-26 17:05:33 -05:00
David Hill
01b6ad7196 Reset batch on error 2013-11-26 16:42:55 -05:00
Josh Rickmar
de9176b94f Fix listtransactions optarg indexes. 2013-11-26 16:21:19 -05:00
Josh Rickmar
97a4ab6a47 Update test coverage file. 2013-11-26 16:12:54 -05:00
Josh Rickmar
368d6c0779 Fix optarg handling for listtransactions and add tests. 2013-11-26 16:08:31 -05:00
David Hill
ca502abbf2 Two fixes
fix returning error on insertTx and doSpend.
clear the batch on failures as well.
2013-11-26 15:58:13 -05:00
Josh Rickmar
d1570c5d87 Include more data in tx-to-wallet-address notifications.
This updates the replies for rescan and tx notifications with
additional information that is needed for wallet to properly support
the listtransactions command.

While here, drastically improve rescan performance by not looking up
every sha in rescan's block range.
2013-11-26 15:07:01 -05:00
Dave Collins
dfbb9446c4 Ensure Win service bits only compile on Windows. 2013-11-25 20:58:18 -06:00
Dave Collins
45732c99fb Allow btcd to run as a Windows service.
This commit modifies btcd to run cleanly as a Windows service.  btcd is
intended to be a long running process that stays synchronized with the
bitcoin block chain and provides chain services to multiple users.  It
follows that a service is the best option on Windows for this
functionality.

A few key points are:

- Supports graceful shutdown via the service stop/shutdown commands
- Integrates cleanly with the Windows event log
- Adds a new /s flag that can be used to install/remove/start/stop the
  service

One outstanding issue is that the application data directory is currently
user specific which means, by default, if you start btcd as a user, the
same data won't be used as when it's running as a service.  This needs to
be resovled.  The most likely approach will be to put all data into the
common appdata directory Windows provides, but it will require some
additional work to deal with permissions properly as user processes can't
write there by default.

Closes #42.
2013-11-25 18:36:11 -06:00
Dave Collins
766aae5a72 Add rolling log file.
This commit modifies the logging to also log all output to a rolling log
file in the btcd home directory under the logs folder.  It uses a maximum
size of 10MB per log file and a max rotation size of 3.  This means the
log files will not exceed 30 megabytes.
2013-11-25 13:40:53 -06:00
Josh Rickmar
7e21226ca6 Update for new btcws.TxMinedNtfn information. 2013-11-25 12:54:23 -05:00
Josh Rickmar
dd3c9b2b5f Send additional block information with a TxMinedNtfn. 2013-11-25 12:54:01 -05:00
Dave Collins
8e3ede441b Update for recent go-flags API changes. 2013-11-24 12:33:36 -06:00
Josh Rickmar
6f2b96b7e2 Fix help message for listtransactions. 2013-11-22 15:18:23 -05:00
Josh Rickmar
d00ca48475 Print listtransactions replies with go-spew. 2013-11-22 14:20:31 -05:00
Owain G. Ainsworth
f843c141ae in Valid() ensure that na.IP is set. Found by drahn. 2013-11-22 18:48:36 +00:00
Dave Collins
a9bf28af4d Allow the overall log level to be dynamically set.
The code was previously only changing the logging level if it wasn't the
default which is accurate for setting the log level once at startup time,
but it needs to set it unconditionally to allow dynamic updates.
2013-11-22 12:46:44 -06:00
Josh Rickmar
ef47455b05 Add listtransactions support to btcctl.
This is currently using the generic reply formater, and will likely be
switched out for a custom one later.
2013-11-22 13:13:39 -05:00
Josh Rickmar
79fe2e594b Fix a typo. 2013-11-22 12:22:07 -05:00
Dave Collins
daa5310e2f Add support for debuglevel RPC command.
Also include the supported subsystems in the error message if an invalid
subsystem is specified.

Closes #15.
2013-11-22 10:47:29 -06:00
Dave Collins
a645c36f45 Add new extension command named debuglevel.
ok @jcvernaleo.
2013-11-22 10:16:45 -06:00
John C. Vernaleo
e930dc55f0 Change a variable name to match btcjson. 2013-11-22 08:50:15 -05:00
John C. Vernaleo
7397dd6896 Rename reqSig to reqSigs
Match bitcoin json name better.

Closes #9
2013-11-22 08:48:02 -05:00
Dave Collins
07c656c8b5 Update doc.go with new debug level usage. 2013-11-21 20:01:11 -06:00
Dave Collins
93c1f7d31b Update utilities to use new btclog as well. 2013-11-21 19:03:55 -06:00
Dave Collins
f7f51a1e43 Use btclog for logging. 2013-11-21 17:44:35 -06:00
Dave Collins
48ab97c271 Allow per-subsystem log levels to be specified.
Now that each subsystem is capable of having its own log level, modify the
-d/--debuglevel flag to allow them to be specified.

Closes #48.
2013-11-21 17:41:45 -06:00
Dave Collins
eb8688df79 Convert btcd to use new btclog package.
Also, make every subsystem within btcd use its own logger instance so each
subsystem can have its own level specified independent of the others.

This is work towards #48.
2013-11-21 17:41:21 -06:00
Owain G. Ainsworth
41d2d36643 Only update p.na on reciept of version message for inbound peers.
Outbound we already have the exact same thing set up, and this should
quieten the race detector. Please note that this does *not* cause
problems with the service flags being wrong. Since by this point we have
already done every thing that would use the service flags from p.na in
addrmanager, and now p.Services is correct..
2013-11-21 19:19:17 +00:00
Owain G. Ainsworth
95b3c063e3 remove lazy computation of QPlus1Div4 and do at init time.
Should shut up the race detector (thought this should be harmless)
2013-11-21 18:59:15 +00:00
Owain G. Ainsworth
8a19f269ca use passed in parameter and not global in log message.
Should shut up the race detector (and make the printf more correct)
2013-11-21 18:23:45 +00:00
Dave Collins
fc11da9ca0 Gofmt. 2013-11-21 09:48:57 -06:00
Dave Collins
3bc401fed1 Use btclog for logging. 2013-11-21 09:48:16 -06:00
Dave Collins
58e5fd3aec Use btclog for logging. 2013-11-21 09:36:58 -06:00
Marco Peereboom
694fccefa8 typo 2013-11-20 15:55:36 -06:00
John C. Vernaleo
3f37e881dc Remove workaround for certs on go1.1.2.
btcd now requires go1.2.  A note to that effect is in README.md.
2013-11-20 15:34:37 -05:00
Josh Rickmar
0bee8478a9 Fix optional arg handling for importprivkey. 2013-11-20 11:12:00 -05:00
Josh Rickmar
fa2bf4423e Add additional tests for importprivkey. 2013-11-20 11:08:20 -05:00
Josh Rickmar
4a290162ee Add dumpprivkey to btcctl. 2013-11-19 22:36:25 -05:00
David Hill
0301690499 Create the home directory if it doesn't exist. 2013-11-19 22:21:50 -05:00
Dave Collins
9643cb6d23 Make golint happy with btcctl. 2013-11-19 20:35:49 -06:00
Dave Collins
b1ed5f75ca Add version to btcctl.
This commit adds version information to btcctl.  The plan is to keep
it in lock step with the btcd version.  It also updates the release script
so the version file is updated automatically with the btcd one.
2013-11-19 20:07:31 -06:00
Dave Collins
9c26f6c4c5 Update doc.go with recent Winows path change. 2013-11-19 18:40:56 -06:00
Dave Collins
0cc756337e Update command line options in doc.go. 2013-11-19 18:16:29 -06:00
Dave Collins
f5a7dcdcbf Default RPC server listener to localhost. 2013-11-19 17:33:36 -06:00
Josh Rickmar
5d13288174 Check auth header for websocket connections. 2013-11-19 18:28:08 -05:00
Dave Collins
9edf7d44fa Ensure generated cert contains 127.0.0.1. 2013-11-19 16:35:00 -06:00