Commit graph

112 commits

Author SHA1 Message Date
Dave Collins
34db203930 Update SearchRawTransaction calls for latest API.
This commit modifies the SearchRawTransactions and
SearchRawTransactionsVerbose functions to work properly with the latest
searchrawtransactions API in btcd.

In particular, this involves changing the return value from
[]*btcjson.TxRawResult to []*btcjson.SearchRawTransactionResult and
adding the additional optional parameter which specifies whether or not
to include information about the previous outputs.
2015-08-26 12:49:14 -05:00
John C. Vernaleo
7cb04ae6db Update example code.
Example code used old api for
OnBlockConnected and OnBlockDisconnected
2015-06-18 16:21:03 -04:00
Josh Rickmar
1831071905 Parse/notify times from block(dis)connected notifications. 2015-06-18 12:14:42 -04:00
Josh Rickmar
77baeb8d79 Fix data race.
This synchronizes access to the (*Client).disconnect channel, which
may change during reconnects.

Fixes #54.
2015-06-15 11:38:25 -04:00
Josh Rickmar
ee3a86c44b Make listsinceblock block hash optional.
Before, calling ListSinceBlock(Async) would create an empty string
from the nil block hash.
2015-06-01 14:41:23 -04:00
Alex Akselrod
9874580e5b Add Generate support in mining.go.
- Create FutureGenerateResult type with Receive() method

- Create GenerateAsync method for Client which returns a
  FutureGenerateResult

- Create Generate method for Client which calls GenerateAsync
  and then calls Receive() on the returned FutureGenerateResult
2015-05-05 16:52:53 -04:00
Dave Collins
b046f36c72 Relicense to the btcsuite developers. 2015-05-01 12:03:51 -05:00
Dave Collins
dd8dc87577 Run goimports -w . 2015-05-01 10:54:58 -05:00
Dave Collins
ce9e8aa264 Update btcjson path import paths to new location. 2015-05-01 10:42:52 -05:00
Albert Puigsech Galicia
b1d5c1b9f6 Add account param on GetNewAddress 2015-04-27 00:44:16 +02:00
Josh Rickmar
13b872259d Remove dependence on btcjson.NewOutPointFromWire. 2015-04-23 14:55:35 -04:00
Alex Akselrod
05f1d6c89a Change parseTxAcceptedNtfnParams to accept a float64 returned by btcd. 2015-04-17 14:20:39 -04:00
Dave Collins
34c87a7340 Add golint to TravisCI builds. 2015-04-05 23:00:36 -05:00
Dave Collins
774eb787a8 Rename HttpPostMode conn param to HTTPPostMode.
This rename is to make golint happy.
2015-04-05 23:00:33 -05:00
Dave Collins
c4bc5220bc Update for recent GetTxOut argument change. 2015-04-05 23:00:29 -05:00
Dave Collins
3daafd5617 Add SearchRawTransactions support. 2015-04-05 23:00:22 -05:00
Javed Khan
04a3ed28f5 Added ImportAddress and ImportPubKey support. 2015-04-05 22:56:54 -05:00
Dave Collins
9ca93b30ad Update to make use of latest version of btcjson.
This commit contains several changes needed to update the client to use
the latest version of btcjson.  In addition, it contains a couple of other
minor changes along the way.

While the underlying changes are quite large, the public API of this
package is still the same, so caller should generally not have to update
their code due to that.  However, the underlying btcjson package API has
changed significantly.  Since this package hides the vast majority of that
from callers, it should not afffect them very much.  However, one area in
particular to watch out for is that the old btcjson.Error is now
btcjson.RPCError, so any callers doing any type assertions there will need
to update.

The following is a summary of the changes:

- The underlying btcjson significantly changed how commands work, so the
  internals of this package have been reworked to be based off of requests
  instead of the now non-existant btcjson.Cmd interface
- Update all call sites of btcjson.New<Foo>Cmd since they can no longer
  error or take varargs
- The ids for each request are part of the request now instead of the
  command to match the new btcjson model and are strict uint64s so type
  assertions are no longer needed (slightly improved efficiency)
- Remove the old temporary workaround for the getbalance command with an
  account of "*" since btcwallet has since been fixed
- Change all instances of JSONToAmount to btcutil.NewAmount since that
  function was removed in favor of btcutil.Amount
- Change all btcws invocations to btcjson since they have been combined
2015-04-05 22:56:39 -05:00
Dave Collins
d45f4c47a2 Update btcws path import paths to new location. 2015-02-19 13:08:29 -06:00
Dave Collins
23ab2bf329 Update btcjson path import paths to new location. 2015-02-19 12:00:51 -06:00
Dave Collins
7d4e1e17f0 Update btcnet path import paths to new location. 2015-02-05 23:39:15 -06:00
Josh Rickmar
87ef953a63 Update Go versions for Travis. 2015-02-05 17:24:42 -05:00
Dave Collins
ed821410cb Update btcwire path import paths to new location. 2015-02-05 15:50:03 -06:00
Javed Khan
20ff0689d8 Added async version for CreateNewAccount, RenameAccount 2015-01-23 17:32:22 +05:30
Dave Collins
bc36ac6d52 Update btcd import paths to new location. 2015-01-17 01:18:22 -06:00
Dave Collins
04f541082a Update btcwallet import paths to new location. 2015-01-17 00:30:49 -06:00
Dave Collins
64231158a0 Update btcjson import paths to new location. 2015-01-16 23:56:08 -06:00
Dave Collins
9e86f74c50 Update btcws import paths to new location. 2015-01-16 23:38:11 -06:00
Dave Collins
fccfbbb347 Update btcnet import paths to new location. 2015-01-16 17:36:51 -06:00
Dave Collins
c1df139e32 Update btcwire import paths to new location. 2015-01-16 15:28:53 -06:00
Javed Khan
132207cb3f Added CreateNewAccount, RenameAccount 2015-01-17 00:45:41 +05:30
Dave Collins
a02ba2b4b1 Update btclog import paths to new location. 2015-01-16 13:08:45 -06:00
Dave Collins
231854f24b Update go-socks import paths to new location. 2015-01-16 01:29:50 -06:00
Dave Collins
62b2ec081a Update btcrpcclient import paths to new location. 2015-01-15 21:21:40 -06:00
Dave Collins
d3d5618ef9 Update TravisCI to goclean script.
Also update to use the new container-based builds

For now, golint has been disabled since it fails due to wanting
HTTPPostMode.  This change will be made as a part of the upgrade to use
btcjson2 since it involves an API change.
2015-01-15 20:58:39 -06:00
Dave Collins
d5cbdf8492 Fix a couple of issues found by golint. 2015-01-15 18:09:18 -06:00
Dave Collins
bbec5f3a91 Update websocket import paths to new location. 2015-01-15 17:25:14 -06:00
Dave Collins
3dfefc978f Update btcutil import paths to new location. 2015-01-15 10:41:20 -06:00
Dave Collins
c74bb4e087 Update license year to 2015. 2015-01-03 02:24:28 -06:00
David Hill
37fbff291c Add missing error check 2014-12-13 10:02:59 -05:00
Jimmy Song
59e825d796 Added GetTxOut as a possible command to btcrpcclient.
Put into chain.go vs other places as per @davecgh
2014-10-26 17:30:10 -05:00
Dave Collins
a8dda1fabf Add ListReceivedByAddress support.
This commit also fixes a couple of comment typos found while adding
support for ListReceivedByAddress.

Closes #20.
2014-10-26 17:16:28 -05:00
Javed Khan
331f25f506 compatiblity hack for blockchain.info getbalance 2014-09-10 21:22:09 +05:30
Josh Rickmar
160a843171 Allow websocket conns to be established after New.
ok @davecgh
2014-07-25 13:17:43 -05:00
Josh Rickmar
6b8ff7f52f Use block shas for rescan begin/end.
Also send block sha and block time for rescanprogress/finished.

ok @davecgh
2014-07-25 13:17:30 -05:00
Dave Collins
a07dadb600 Add Move support.
This commit adds the Move, MoveAsync, MoveMinConf, MoveMinConfAsync,
MoveComment, and MoveCommentAsync functions for issuing the "move" RPC
with various optional parameters.

Closes #16.
2014-07-09 21:42:50 -05:00
Michalis Kargakis
406dd2fcb7 Fix typos 2014-07-08 15:40:53 +03:00
Dave Collins
656fa8699b Improve disconnect and shutdown handling.
Previously the exported Disconnect and Shutdown functions called each other
and therefore needed to release and reacquire the locks which could
potentionally allow a request to sneak in between the lock and unlock.

This commit changes the exported Shutdown function so that everything is
done under the request lock to prevent this possibility.  In order to
support this, the shared code between the Disconnect and Shutdown
functions has been refactored into unexported functions and the locking
has been altered accordingly.

Also, replace the sendMessage function with a select over the send and
disconnect channels to prevent any issues with queued up messages.

joint debugging effort between myself and @jrick
2014-07-07 21:58:13 -05:00
Josh Rickmar
1a23feb53e Fix hang on new request receives after shutdown.
Previously, requests could still be sent to a shutdown client and
added to the client's internal data structures, without ever
responding to the future with an error for a shutdown client (causing
hangs when blocking on the future receive).  This change fixes this by
performing a non-blocking read of the client's shutdown channel before
adding a request, and responding with the shutdown error if the client
has begun or completed its shutdown.

ok @davecgh
2014-07-07 19:11:50 -05:00
Dave Collins
1a866200e3 Improve websocket connection error handling.
This commit modifies the error handling for websocket connections to fall
back to returning the status text returned from the server if the
handshake fails and it's not due to an authentication or invalid endpoint.
2014-07-03 12:31:53 -05:00