Commit graph

113 commits

Author SHA1 Message Date
Josh Rickmar
18fb993d0b Implement address rescanning.
When a wallet is opened, a rescan request will be sent to btcd with
all active addresses from the wallet, to rescan from the last synced
block (now saved to the wallet file) and the current best block.

As multi-account support is further explored, rescan requests should
be batched together to send a single request for all addresses from
all wallets.

This change introduces several changes to the wallet, tx, and utxo
files.  Wallet files are still compatible, however, a rescan will try
to start at the genesis block since no correct "last synced to" or
"created at block X" was saved.  The tx and utxo files, however, are
not compatible and should be deleted (or an error will occur on read).
If any errors occur opening the utxo file, a rescan will start
beginning at the creation block saved in the wallet.
2013-11-01 10:06:38 -04:00
Josh Rickmar
3c390364d7 Switch some integers from unsigned to signed.
This change switches the time fields (firstSeen/lastSeen) of an
address from uint64 to int64, to be compatible with (time.Time).Unix,
as well as changing the block height fields (firstBlock/lastBlock)
from uint32 to int32, since block height is normally represented
signed.
2013-10-28 09:15:26 -04:00
Josh Rickmar
50073b32c1 Save correct addresses for new utxos 2013-10-10 18:44:44 -04:00
Josh Rickmar
9cc6600db2 Fixes for api changes 2013-10-08 13:36:39 -04:00
Josh Rickmar
c85a3a29e3 'err != nil' -> 'err == nil', fixes getaddressesbyaccount 2013-10-07 22:22:47 -04:00
Josh Rickmar
3c4ff4b0f4 Add support for running wallet on testnet3.
Websocket connections to btcd will be closed if btcd and btcwallet are
running on different networks.
2013-10-07 13:09:24 -04:00
Josh Rickmar
63686347c6 Create transactions using saved utxo data.
This is a big change that also many general fixes to problems found
when creating transactions.  In particular the Utxo and Tx formats and
serialization functions were updated with additional information that
would be necessary for rolling back old utxo and tx data data after
btcd chain switches.  This change also implements the json methods
'sendfrom' and 'sendmany' to create a new transaction based on a
frontend request.

Transactions are currently not sent to btcd since the tx relay code is
not finished yet, so a temporary error is returned back to frontends
who try to send new transactions.
2013-10-01 14:26:27 -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
b495842b0e Set defualt highestUsed chained address to -1 (root). 2013-09-03 16:35:07 -04:00
Josh Rickmar
9eae969230 Implement new wallet and chained address creation. 2013-09-03 00:10:32 -04:00
Josh Rickmar
cc13f2eed5 Implement JSON extension walletislocked 2013-08-21 14:46:20 -04:00
Josh Rickmar
92a79baeff Implement (*Wallet).Lock() and reply with correct JSON 2013-08-21 13:25:22 -04:00
Josh Rickmar
a56e4e89d2 Initial commit. 2013-08-21 10:37:30 -04:00