Commit graph

291 commits

Author SHA1 Message Date
Josh Rickmar
897fa1448b Return comprehensive errors when opening wallets. 2013-09-05 09:43:53 -04:00
Josh Rickmar
90b9a98802 Remove unused func. 2013-09-04 20:41:09 -04:00
Josh Rickmar
6e20de7c4a Interpret btcd:blockconnected hash as string.
btcd was changed to send the block hash for new block notifications as
a big endian string, so type assert as a string and convert to a
btcwire.ShaHash.
2013-09-04 20:38:57 -04:00
Josh Rickmar
79d1491ac4 Save index from tx notifications to utxo store. 2013-09-04 16:36:48 -04:00
Josh Rickmar
2d5950299f Unbreak build caused by changes in tx pkg. 2013-09-04 16:21:03 -04:00
Josh Rickmar
a6ad4cf48c Save index as well as tx hash for outputs. 2013-09-04 16:16:20 -04:00
Josh Rickmar
34dc33d48c requesttxs -> notifynewtxs 2013-09-04 14:14:21 -04:00
Josh Rickmar
be538d149e Combine tx and utxo requesters.
btcd now has only one notifier mechanism for received transactions to
a watched address.  This previously combines the seperate notifiers
for generic tx and exclusively unspent outputs.

A new handler will be added to watch for spent outputs instead of
relying on the now-removed "btcd:sendtx" notification.
2013-09-04 13:41:33 -04:00
Josh Rickmar
419ceb55c6 Implement Utxo notification handler to add to utxo store. 2013-09-04 09:54:06 -04:00
Josh Rickmar
0928361f22 Save address with Utxo.
We want only one utxo file per wallet, so each serialized Utxo needs
to also contain the receiving address.
2013-09-04 09:32:14 -04:00
Josh Rickmar
a1d3800feb Remove basic tx/utxo handlers as id routing handles this now. 2013-09-03 21:20:48 -04:00
Josh Rickmar
46077ac50a Pass wallet pointer as receiver for requester funcs.
Each wallet needs its own handler running and listening to replies
from btcd, so that wallet can be synced to disk with the new tx or
utxo information.  Another rounter to map from addresses to wallets
could have been written, but we'll use the JSON Id router message
router instead.
2013-09-03 19:05:59 -04:00
Josh Rickmar
85425c2c80 Abstract out wallet tracking function.
This will soon be used to also implement tracking of utxo and txs for
address in this wallet.
2013-09-03 17:16:07 -04:00
Josh Rickmar
42274b143f Defer closing files when reading saved wallet. 2013-09-03 17:05:22 -04:00
Josh Rickmar
3d6ad329d0 Set Jsonrpc string when manually creating json messages. 2013-09-03 16:35:54 -04:00
Josh Rickmar
b495842b0e Set defualt highestUsed chained address to -1 (root). 2013-09-03 16:35:07 -04:00
Josh Rickmar
28c679ee82 Reply with nil result if wallet creation succeeded. 2013-09-03 12:16:02 -04:00
Josh Rickmar
e3416add35 Implement 'getbalance' replier (currently replies with 0). 2013-09-03 11:00:01 -04:00
Josh Rickmar
1918bd3698 Do not fail if default wallet does not exist.
We must instead wait for the user to explicitly generate their own
wallet for an account name.  This is because all btcwallet wallets
must be encrypted, and the passphrase must be known at time of wallet
generation.
2013-09-03 10:21:14 -04:00
Josh Rickmar
1c1ab52ef7 Implement new JSON extension 'createencryptedwallet'. 2013-09-03 09:49:16 -04:00
Josh Rickmar
9eae969230 Implement new wallet and chained address creation. 2013-09-03 00:10:32 -04:00
Josh Rickmar
cfde81a062 Remove shadowed variable. 2013-08-28 09:02:24 -04:00
Josh Rickmar
c86571be0c I even did the go fmt this time but forgot to stage it. 2013-08-27 17:19:35 -04:00
Josh Rickmar
f5a151571d Begin handling of newly connected blocks.
Utxo and Tx stores are not updated yet as they aren't being created at
the moment.  Disconnected blocks are currently ignored.
2013-08-27 16:47:50 -04:00
Josh Rickmar
ab623ec9e0 Read and write tx fee from SendTxs 2013-08-27 12:39:45 -04:00
Josh Rickmar
d89cdaca08 go fmt 2013-08-26 13:35:29 -04:00
Josh Rickmar
7716ad7e38 Tests for RecvTx, SendTx, and TxStore 2013-08-26 13:34:18 -04:00
Josh Rickmar
a080d13f1c go fmt 2013-08-26 10:52:57 -04:00
Josh Rickmar
347b15ba3a Add ReadFrom and WriteTo tests for Utxo and UtxoStore 2013-08-26 10:48:42 -04:00
Josh Rickmar
e80d089a15 Implement io.ReaderFrom and io.WriterTo tx/utxo types.
These are currently untested.
2013-08-23 14:28:07 -04:00
Josh Rickmar
50b69f44b7 Add missing licenses to files 2013-08-22 12:30:38 -04:00
Josh Rickmar
39259bee37 Notify frontends when wallet is locked or unlocked. 2013-08-22 12:00:37 -04:00
Josh Rickmar
eec4c64ac6 And another one. 2013-08-21 15:28:15 -04:00
Josh Rickmar
4f4807a003 Fix logic error: err != nil -> err == nil 2013-08-21 15:26:00 -04:00
Josh Rickmar
cc13f2eed5 Implement JSON extension walletislocked 2013-08-21 14:46:20 -04:00
Josh Rickmar
b0f6a70d40 Use ReplySuccess() to send successful JSON replies 2013-08-21 13:43:05 -04:00
Josh Rickmar
8f38a43964 Send JSON reply after successfully decrypting wallet 2013-08-21 13:29:36 -04:00
Josh Rickmar
92a79baeff Implement (*Wallet).Lock() and reply with correct JSON 2013-08-21 13:25:22 -04:00
Josh Rickmar
1aa324684d Send error replies for walletpassphrase 2013-08-21 12:07:57 -04:00
Josh Rickmar
af4df4a3d5 Implement standard RPC errors. 2013-08-21 12:06:34 -04:00
Josh Rickmar
a56e4e89d2 Initial commit. 2013-08-21 10:37:30 -04:00