[lbry] fork from btcsuite to lbryio

1. btcd -> lbcd
2. btcwallet -> lbcallet
3. btcutil -> lbcutil
This commit is contained in:
Roy Lee 2021-08-25 15:58:28 -07:00
parent 7b5b2ff774
commit 202374ebd8
115 changed files with 911 additions and 896 deletions

2
.gitignore vendored
View file

@ -1,4 +1,4 @@
btcwallet lbcwallet
vendor vendor
.idea .idea
.vscode .vscode

144
CHANGES
View file

@ -1,17 +1,17 @@
============================================================================ ============================================================================
User visible changes for btcwallet User visible changes for lbcwallet
A wallet daemon for btcd, written in Go A wallet daemon for lbcd, written in Go
============================================================================ ============================================================================
Changes in 0.7.0 (Mon Nov 23 2015) Changes in 0.7.0 (Mon Nov 23 2015)
- New features: - New features:
- Wallet will now detect network inactivity and reconnect to the btcd - Wallet will now detect network inactivity and reconnect to the lbcd
RPC server if the connection was lost (#320) RPC server if the connection was lost (#320)
- Bug fixes: - Bug fixes:
- Removed data races in the RPC server (#292) and waddrmgr package - Removed data races in the RPC server (#292) and waddrmgr package
(#293) (#293)
- Corrected handling of btcutil.AddressPubKey addresses when querying - Corrected handling of lbcutil.AddressPubKey addresses when querying
for a ManagedAddress from the address manager (#313) for a ManagedAddress from the address manager (#313)
- Fixed signmessage and verifymessage algorithm to match the equivalent - Fixed signmessage and verifymessage algorithm to match the equivalent
algorithms used by Core (#324) algorithms used by Core (#324)
@ -29,7 +29,7 @@ Changes in 0.7.0 (Mon Nov 23 2015)
- Miscellaneous: - Miscellaneous:
- Updated websocket notification handlers to latest API required by - Updated websocket notification handlers to latest API required by
btcd (#294) lbcd (#294)
- Enabled the logging subsystem of the rpcclient package (#328) - Enabled the logging subsystem of the rpcclient package (#328)
- Contributors (alphabetical order): - Contributors (alphabetical order):
@ -51,7 +51,7 @@ Changes in 0.6.0 (Wed May 27 2015)
- RPC requests with an unspecified account that default to the unnamed - RPC requests with an unspecified account that default to the unnamed
account in Bitcoin Core Wallet default to "default", the name of the account in Bitcoin Core Wallet default to "default", the name of the
initial account initial account
- Several RPCs with account parameters do not work with btcwallet - Several RPCs with account parameters do not work with lbcwallet
accounts due to concerns over expectations of API compatibility with accounts due to concerns over expectations of API compatibility with
Bitcoin Core Wallet. A new RPC API is being planned to rectify this Bitcoin Core Wallet. A new RPC API is being planned to rectify this
(#220). (#220).
@ -62,13 +62,13 @@ Changes in 0.6.0 (Wed May 27 2015)
- Add utility (cmd/dropwtxmgr) to drop transaction history and force a - Add utility (cmd/dropwtxmgr) to drop transaction history and force a
rescan (#234) rescan (#234)
- Implement the help RPC to return single line usages of all wallet and - Implement the help RPC to return single line usages of all wallet and
btcd server requests as well as detailed usage for a single request lbcd server requests as well as detailed usage for a single request
- Bug fixes: - Bug fixes:
- Handle chain reorgs by unconfirming transactions from removed blocks - Handle chain reorgs by unconfirming transactions from removed blocks
(#248) (#248)
- Rollback all transaction history when none of the saved recently seen - Rollback all transaction history when none of the saved recently seen
block hashes are known to btcd (#234, #281) block hashes are known to lbcd (#234, #281)
- Prevent the situation where the default account was renamed but cannot - Prevent the situation where the default account was renamed but cannot
be renamed back to "" or "default" by removing the special case naming be renamed back to "" or "default" by removing the special case naming
policy for the default account (#253) policy for the default account (#253)
@ -96,18 +96,18 @@ Changes in 0.6.0 (Wed May 27 2015)
updates at a time under a single database transaction. updates at a time under a single database transaction.
- Notable developer-related changes: - Notable developer-related changes:
- Relicense all code to the btcsuite developers (#258) - Relicense all code to the lbcsuite developers (#258)
- Replace txstore package with wtxmgr, the walletdb-based transaction - Replace txstore package with wtxmgr, the walletdb-based transaction
store (#217, #234) store (#217, #234)
- Add Cursor API to walletdb for forwards and backwards iteration over - Add Cursor API to walletdb for forwards and backwards iteration over
a bucket (included in #234) a bucket (included in #234)
- Factor out much of main's wallet.go into a wallet package (#213, - Factor out much of main's wallet.go into a wallet package (#213,
#276, #255) #276, #255)
- Convert RPC server and client to btcjson v2 API (#233, #227) - Convert RPC server and client to lbcjson v2 API (#233, #227)
- Help text and single line usages for the help RPC are pregenerated - Help text and single line usages for the help RPC are pregenerated
from descriptions in the internal/rpchelp package and saved as from descriptions in the internal/rpchelp package and saved as
globals in main. Help text must be regenerated (using `go generate`) globals in main. Help text must be regenerated (using `go generate`)
each time the btcjson struct tags change or the help definitions are each time the lbcjson struct tags change or the help definitions are
modified. modified.
- Add additional features to the votingpool package: - Add additional features to the votingpool package:
- Implement StartWithdrawal API to begin an Open Transactions - Implement StartWithdrawal API to begin an Open Transactions
@ -195,7 +195,7 @@ Changes in 0.5.0 (Tue Mar 03 2015)
- lockunspent, listlockunspent (#50, #55) - lockunspent, listlockunspent (#50, #55)
- getreceivedbyaddress - getreceivedbyaddress
- listreceivedbyaccount - listreceivedbyaccount
- Reimplement btcd RPCs which return the best block to use the block most - Reimplement lbcd RPCs which return the best block to use the block most
recently processed by wallet to avoid confirmation races: recently processed by wallet to avoid confirmation races:
- getbestblockhash - getbestblockhash
- getblockcount - getblockcount
@ -203,14 +203,14 @@ Changes in 0.5.0 (Tue Mar 03 2015)
- Throttle the number of connected HTTP POST and websocket client - Throttle the number of connected HTTP POST and websocket client
connections (tunable using the rpcmaxclients and rpcmaxwebsockets config connections (tunable using the rpcmaxclients and rpcmaxwebsockets config
options) options)
- Provide the ability to disable TLS when connecting to a localhost btcd or - Provide the ability to disable TLS when connecting to a localhost lbcd or
serving localhost clients serving localhost clients
- Rescan improvements: - Rescan improvements:
- Add a rescan notification for when the rescan has completed and no more - Add a rescan notification for when the rescan has completed and no more
rescan notifications are expected (#99) rescan notifications are expected (#99)
- Use the most recent partial sync height from a rescan progress - Use the most recent partial sync height from a rescan progress
notification when a rescan is restarted after the btcd connection is lost notification when a rescan is restarted after the lbcd connection is lost
- Force a rescan if the transaction store cannot be opened (due to a - Force a rescan if the transaction store cannot be opened (due to a
missing file or if the deserialization failed) missing file or if the deserialization failed)
@ -231,7 +231,7 @@ Changes in 0.5.0 (Tue Mar 03 2015)
- Mark unconfirmed transaction credits as spent when another unconfirmed - Mark unconfirmed transaction credits as spent when another unconfirmed
transaction spends one (#91) transaction spends one (#91)
- Exclude immature coinbase outputs from listunspent results (#103) - Exclude immature coinbase outputs from listunspent results (#103)
- Fix several data and logic races during sync with btcd (#101) - Fix several data and logic races during sync with lbcd (#101)
- Avoid a memory issue from incorrect slice usage which caused both - Avoid a memory issue from incorrect slice usage which caused both
duplicate and missing blocks in the transaction store when middle duplicate and missing blocks in the transaction store when middle
inserting transactions from a new block inserting transactions from a new block
@ -239,9 +239,9 @@ Changes in 0.5.0 (Tue Mar 03 2015)
transactions (#89) transactions (#89)
- Return the correct UTXO set when fetching all wallet UTXOs by fixing an - Return the correct UTXO set when fetching all wallet UTXOs by fixing an
incorrect slice append incorrect slice append
- Remove a deadlock caused by filling the btcd notification channel (#100) - Remove a deadlock caused by filling the lbcd notification channel (#100)
- Avoid a confirmation race by using the most recently processed block in - Avoid a confirmation race by using the most recently processed block in
RPC handlers, rather than using the most recently notified block by btcd RPC handlers, rather than using the most recently notified block by lbcd
- Marshal empty JSON arrays as `[]` instead of the JSON `null` by using - Marshal empty JSON arrays as `[]` instead of the JSON `null` by using
empty, non-nil Go slices empty, non-nil Go slices
- Flush logs and run all deferred functions before main returns and the - Flush logs and run all deferred functions before main returns and the
@ -253,13 +253,13 @@ Changes in 0.5.0 (Tue Mar 03 2015)
- Switch from the go.net websocket package to gorilla websockets - Switch from the go.net websocket package to gorilla websockets
- Refactor the RPC server: - Refactor the RPC server:
- Move several global variables to the rpcServer struct - Move several global variables to the rpcServer struct
- Dynamically look up appropriate handlers for the current btcd connection - Dynamically look up appropriate handlers for the current lbcd connection
status and wallet sync state status and wallet sync state
- Begin creating websocket notifications by sending to one of many - Begin creating websocket notifications by sending to one of many
notification channels in the rpcServer struct, which are in turn notification channels in the rpcServer struct, which are in turn
marshalled and broadcast to each websocket client marshalled and broadcast to each websocket client
- Separate the RPC client code into the chain package: - Separate the RPC client code into the chain package:
- Uses rpcclient for a btcd websocket RPC client - Uses rpcclient for a lbcd websocket RPC client
- Converts all notification callbacks to typed messages sent over channels - Converts all notification callbacks to typed messages sent over channels
- Uses an unbounded queue for waiting notifications - Uses an unbounded queue for waiting notifications
- Import a new voting pool package (votingpool): - Import a new voting pool package (votingpool):
@ -270,7 +270,7 @@ Changes in 0.5.0 (Tue Mar 03 2015)
- Check and handle all errors in some way, or explicitly comment why a - Check and handle all errors in some way, or explicitly comment why a
particular error was left unchecked particular error was left unchecked
- Simplify RPC error handling by wrapping specific errors in unique types to - Simplify RPC error handling by wrapping specific errors in unique types to
create an appropriate btcjson error before the response is marshalled create an appropriate lbcjson error before the response is marshalled
- Add a map of unspent outputs (keyed by outpoint) to the transaction store - Add a map of unspent outputs (keyed by outpoint) to the transaction store
for quick lookup of any UTXO and access to the full wallet UTXO set for quick lookup of any UTXO and access to the full wallet UTXO set
without iterating over many transactions looking for unspent credits without iterating over many transactions looking for unspent credits
@ -280,7 +280,7 @@ Changes in 0.5.0 (Tue Mar 03 2015)
- Miscellaneous: - Miscellaneous:
- Rewrite paths relative to the data directory when an alternate data - Rewrite paths relative to the data directory when an alternate data
directory is provided on the command line directory is provided on the command line
- Switch the websocket endpoint to `ws` to match btcd - Switch the websocket endpoint to `ws` to match lbcd
- Remove the getaddressbalance extension RPC to discourage address reuse and - Remove the getaddressbalance extension RPC to discourage address reuse and
encourage watching for expected payments by using listunspent encourage watching for expected payments by using listunspent
- Increase transaction creation performance by moving the sorting of - Increase transaction creation performance by moving the sorting of
@ -293,27 +293,27 @@ Changes in 0.5.0 (Tue Mar 03 2015)
- [debug] Log each transaction that is removed in a rollback - [debug] Log each transaction that is removed in a rollback
- Only log rollbacks if transactions are reorged out of the old chain - Only log rollbacks if transactions are reorged out of the old chain
- Save logs to network-specific directories - Save logs to network-specific directories
(e.g. ~/.btcwallet/logs/testnet3) to match btcd behavior (#114) (e.g. ~/.lbcwallet/logs/testnet3) to match lbcd behavior (#114)
Changes in 0.4.0 (Sun May 25 2014) Changes in 0.4.0 (Sun May 25 2014)
- Implement the following standard bitcoin server RPC requests: - Implement the following standard bitcoin server RPC requests:
- signmessage (https://github.com/conformal/btcwallet/issues/58) - signmessage (https://github.com/lbryio/lbcwallet/issues/58)
- verifymessage (https://github.com/conformal/btcwallet/issues/61) - verifymessage (https://github.com/lbryio/lbcwallet/issues/61)
- listunspent (https://github.com/conformal/btcwallet/issues/54) - listunspent (https://github.com/lbryio/lbcwallet/issues/54)
- validateaddress (https://github.com/conformal/btcwallet/issues/60) - validateaddress (https://github.com/lbryio/lbcwallet/issues/60)
- addressmultisig (https://github.com/conformal/btcwallet/issues/37) - addressmultisig (https://github.com/lbryio/lbcwallet/issues/37)
- createmultisig (https://github.com/conformal/btcwallet/issues/37) - createmultisig (https://github.com/lbryio/lbcwallet/issues/37)
- signrawtransaction (https://github.com/conformal/btcwallet/issues/59) - signrawtransaction (https://github.com/lbryio/lbcwallet/issues/59)
- Add authenticate extension RPC request to authenticate a websocket - Add authenticate extension RPC request to authenticate a websocket
session without requiring the use of the HTTP Authorization header session without requiring the use of the HTTP Authorization header
- Add btcdusername and btcdpassword options to allow separate - Add lbcdusername and lbcdpassword options to allow separate
authentication credentials from wallet clients when authenticating to a authentication credentials from wallet clients when authenticating to a
btcd websocket RPC server lbcd websocket RPC server
- Fix RPC response passthrough: JSON unmarshaling and marshaling is now - Fix RPC response passthrough: JSON unmarshaling and marshaling is now
delayed until necessary and JSON result objects from btcd are sent to delayed until necessary and JSON result objects from lbcd are sent to
clients directly without an extra decode+encode that may change the clients directly without an extra decode+encode that may change the
representation of large integer values representation of large integer values
@ -327,14 +327,14 @@ Changes in 0.4.0 (Sun May 25 2014)
to a length of 32 to a length of 32
- Fix rescan for transaction history for imported addresses - Fix rescan for transaction history for imported addresses
(https://github.com/conformal/btcwallet/issues/74) (https://github.com/lbryio/lbcwallet/issues/74)
- Fix listsinceblock request handler to consider the minimum confirmation - Fix listsinceblock request handler to consider the minimum confirmation
parameter (https://github.com/conformal/btcwallet/issues/80) parameter (https://github.com/lbryio/lbcwallet/issues/80)
- Fix several RPC handlers which require an unlocked wallet to check - Fix several RPC handlers which require an unlocked wallet to check
for an unlocked wallet before continuing for an unlocked wallet before continuing
(https://github.com/conformal/btcwallet/issues/65) (https://github.com/lbryio/lbcwallet/issues/65)
- Fix handling for block rewards (coinbase transactions): - Fix handling for block rewards (coinbase transactions):
- Update listtransactions results to use "generate" category for - Update listtransactions results to use "generate" category for
@ -355,16 +355,16 @@ Changes in 0.4.0 (Sun May 25 2014)
rescan rescan
- Support parially synced addresses in the keystore and incrementally - Support parially synced addresses in the keystore and incrementally
mark rescan progress. If a rescan is unable to continue (wallet mark rescan progress. If a rescan is unable to continue (wallet
closes, btcd disconnects, etc.) a new rescan can start at the last closes, lbcd disconnects, etc.) a new rescan can start at the last
synced chain height synced chain height
- Notify (with an unsolicited notification) websocket clients of btcd - Notify (with an unsolicited notification) websocket clients of lbcd
connection state connection state
- Improve logging: - Improve logging:
- Log reason for disconnecting a websocket client - Log reason for disconnecting a websocket client
- Updates for btcd websocket API changes - Updates for lbcd websocket API changes
- Stability fixes, internal API changes, general code cleanup, and comment - Stability fixes, internal API changes, general code cleanup, and comment
corrections corrections
@ -372,13 +372,13 @@ Changes in 0.4.0 (Sun May 25 2014)
Changes in 0.3.0 (Mon Feb 10 2014) Changes in 0.3.0 (Mon Feb 10 2014)
- Use correct hash algorithm for chained addresses (fixes a bug where - Use correct hash algorithm for chained addresses (fixes a bug where
address chaining was still deterministic, but forked from Armory and address chaining was still deterministic, but forked from Armory and
previous btcwallet implementations) previous lbcwallet implementations)
- Change websocket endpoint to connect to btcd 0.6.0-alpha - Change websocket endpoint to connect to lbcd 0.6.0-alpha
- Redo server implementation to serialize handling of client requests - Redo server implementation to serialize handling of client requests
- Redo account locking to greatly reduce btcwallet lockups caused by - Redo account locking to greatly reduce lbcwallet lockups caused by
incorrect mutex usage incorrect mutex usage
- Open all accounts, rather than just the default account, at startup - Open all accounts, rather than just the default account, at startup
@ -392,23 +392,23 @@ Changes in 0.3.0 (Mon Feb 10 2014)
the minimum fee to all outbound transactions the minimum fee to all outbound transactions
- Implement the following standard bitcoin server RPC requests: - Implement the following standard bitcoin server RPC requests:
- getinfo (https://github.com/conformal/btcwallet/issues/63) - getinfo (https://github.com/lbryio/lbcwallet/issues/63)
- getrawchangeaddress (https://github.com/conformal/btcwallet/issues/41) - getrawchangeaddress (https://github.com/lbryio/lbcwallet/issues/41)
- getreceivedbyaccount (https://github.com/conformal/btcwallet/issues/42) - getreceivedbyaccount (https://github.com/lbryio/lbcwallet/issues/42)
- gettransaction (https://github.com/conformal/btcwallet/issues/44) - gettransaction (https://github.com/lbryio/lbcwallet/issues/44)
- keypoolrefill (https://github.com/conformal/btcwallet/issues/48) - keypoolrefill (https://github.com/lbryio/lbcwallet/issues/48)
- listsinceblock (https://github.com/conformal/btcwallet/issues/52) - listsinceblock (https://github.com/lbryio/lbcwallet/issues/52)
- sendtoaddress (https://github.com/conformal/btcwallet/issues/56) - sendtoaddress (https://github.com/lbryio/lbcwallet/issues/56)
- Add empty (unimplemented) handlers for the following RPC requests so - Add empty (unimplemented) handlers for the following RPC requests so
requests are not passed down to btcd: requests are not passed down to lbcd:
- getblocktemplate - getblocktemplate
- getwork - getwork
- stop - stop
- Add RPC extension request, exportwatchingwallet, to export an account - Add RPC extension request, exportwatchingwallet, to export an account
with a watching-only wallet from an account with a hot wallet that with a watching-only wallet from an account with a hot wallet that
may be used by a separate btcwallet instance may be used by a separate lbcwallet instance
- Require all account wallets to share the same passphrase - Require all account wallets to share the same passphrase
@ -418,16 +418,16 @@ Changes in 0.3.0 (Mon Feb 10 2014)
- Allow opening accounts with watching-only wallets - Allow opening accounts with watching-only wallets
- Return txid for sendfrom RPC requests - Return txid for sendfrom RPC requests
(https://github.com/conformal/btcwallet/issues/64) (https://github.com/lbryio/lbcwallet/issues/64)
- Rescan imported private keys in background - Rescan imported private keys in background
(https://github.com/conformal/btcwallet/issues/34) (https://github.com/lbryio/lbcwallet/issues/34)
- Do not import duplicate private keys - Do not import duplicate private keys
(https://github.com/conformal/btcwallet/issues/35) (https://github.com/lbryio/lbcwallet/issues/35)
- Write all three account files for a new account, rather than just - Write all three account files for a new account, rather than just
the wallet (https://github.com/conformal/btcwallet/issues/30) the wallet (https://github.com/lbryio/lbcwallet/issues/30)
- Create any missing directories before writing autogenerated certificate - Create any missing directories before writing autogenerated certificate
pair pair
@ -446,19 +446,19 @@ Changes in 0.3.0 (Mon Feb 10 2014)
- Fix typos in README file - Fix typos in README file
Changes in 0.2.1 (Thu Jan 10 2014) Changes in 0.2.1 (Thu Jan 10 2014)
- Fix a mutex issue which caused btcwallet to lockup on all - Fix a mutex issue which caused lbcwallet to lockup on all
RPC requests needing to read or write an account RPC requests needing to read or write an account
Changes in 0.2.0 (Thu Jan 09 2014) Changes in 0.2.0 (Thu Jan 09 2014)
- Enable mainnet support (disabled by default, use --mainnet to enable) - Enable mainnet support (disabled by default, use --mainnet to enable)
- Don't hardcode localhost btcd connections. Instead, add a --connect - Don't hardcode localhost lbcd connections. Instead, add a --connect
option to specify the hostname or address and port of a local or option to specify the hostname or address and port of a local or
remote btcd instance remote lbcd instance
(https://github.com/conformal/btcwallet/issues/1) (https://github.com/lbryio/lbcwallet/issues/1)
- Remove --serverport port and replace with --listen. This option works - Remove --serverport port and replace with --listen. This option works
just like btcd's --rpclisten and allows to specify the interfaces to just like lbcd's --rpclisten and allows to specify the interfaces to
listen for RPC connections listen for RPC connections
- Require TLS and Basic HTTP authentication before wallet can be - Require TLS and Basic HTTP authentication before wallet can be
@ -466,28 +466,28 @@ Changes in 0.2.0 (Thu Jan 09 2014)
- Refill keypool if wallet is unlocked and keypool is emptied - Refill keypool if wallet is unlocked and keypool is emptied
- Detect and rollback saved tx/utxo info after btcd performs blockchain - Detect and rollback saved tx/utxo info after lbcd performs blockchain
reorganizations while btcwallet was disconnected reorganizations while lbcwallet was disconnected
- Add support for the following standard bitcoin JSON-RPC calls: - Add support for the following standard bitcoin JSON-RPC calls:
- dumpprivkey (https://github.com/conformal/btcwallet/issues/9) - dumpprivkey (https://github.com/lbryio/lbcwallet/issues/9)
- getaccount - getaccount
- getaccountaddress - getaccountaddress
- importprivkey (https://github.com/conformal/btcwallet/issues/2) - importprivkey (https://github.com/lbryio/lbcwallet/issues/2)
- listtransactions (https://github.com/conformal/btcwallet/issues/12) - listtransactions (https://github.com/lbryio/lbcwallet/issues/12)
- Add several extension RPC calls for websocket connections: - Add several extension RPC calls for websocket connections:
- getaddressbalance: get the balance associated with a single address - getaddressbalance: get the balance associated with a single address
- getunconfirmedbalance: get total balance for unconfirmed transactions - getunconfirmedbalance: get total balance for unconfirmed transactions
- listaddresstransactions: list transactions for a single address - listaddresstransactions: list transactions for a single address
(https://github.com/conformal/btcwallet/issues/27) (https://github.com/lbryio/lbcwallet/issues/27)
- listalltransactions: lists all transactions without specifying a range - listalltransactions: lists all transactions without specifying a range
- Make RPC extensions available only to websocket connections, with the - Make RPC extensions available only to websocket connections, with the
exception of createencryptedwallet exception of createencryptedwallet
- Add dummy handlers for unimplemented wallet RPC calls - Add dummy handlers for unimplemented wallet RPC calls
(https://github.com/conformal/btcwallet/issues/29) (https://github.com/lbryio/lbcwallet/issues/29)
- Add socks5/tor proxy support - Add socks5/tor proxy support
@ -495,22 +495,22 @@ Changes in 0.2.0 (Thu Jan 09 2014)
- Use OS-specific rename calls to provide atomic file renames which - Use OS-specific rename calls to provide atomic file renames which
can replace a currently-existing file can replace a currently-existing file
(https://github.com/conformal/btcwallet/issues/20) (https://github.com/lbryio/lbcwallet/issues/20)
- Move account files to a single directory per bitcoin network to - Move account files to a single directory per bitcoin network to
prevent a future scaling issue prevent a future scaling issue
(https://github.com/conformal/btcwallet/issues/16) (https://github.com/lbryio/lbcwallet/issues/16)
- Fix several data races and mutex mishandling - Fix several data races and mutex mishandling
- Fix a bug where the RPC server hung on requests requiring btcd - Fix a bug where the RPC server hung on requests requiring lbcd
when a btcd connection was never established when a lbcd connection was never established
- Fix a bug where creating account files did not create all necessary - Fix a bug where creating account files did not create all necessary
directories (https://github.com/conformal/btcwallet/issues/15) directories (https://github.com/lbryio/lbcwallet/issues/15)
- Fix a bug where '~' did not expand to a home or user directory - Fix a bug where '~' did not expand to a home or user directory
(https://github.com/conformal/btcwallet/issues/17) (https://github.com/lbryio/lbcwallet/issues/17)
- Fix a bug where returning account names as strings did not remove - Fix a bug where returning account names as strings did not remove
trailing ending 0s trailing ending 0s

View file

@ -1,4 +1,4 @@
PKG := github.com/btcsuite/btcwallet PKG := github.com/lbryio/lbcwallet
LINT_PKG := github.com/golangci/golangci-lint/cmd/golangci-lint LINT_PKG := github.com/golangci/golangci-lint/cmd/golangci-lint
GOACC_PKG := github.com/ory/go-acc GOACC_PKG := github.com/ory/go-acc
@ -64,11 +64,11 @@ goimports:
# ============ # ============
build: build:
@$(call print, "Compiling btcwallet.") @$(call print, "Compiling lbcwallet.")
$(GOBUILD) $(PKG)/... $(GOBUILD) $(PKG)/...
install: install:
@$(call print, "Installing btcwallet.") @$(call print, "Installing lbcwallet.")
$(GOINSTALL) $(PKG) $(GOINSTALL) $(PKG)
$(GOINSTALL) $(PKG)/cmd/dropwtxmgr $(GOINSTALL) $(PKG)/cmd/dropwtxmgr
$(GOINSTALL) $(PKG)/cmd/sweepaccount $(GOINSTALL) $(PKG)/cmd/sweepaccount

View file

@ -1,24 +1,24 @@
btcwallet lbcwallet
========= =========
[![Build Status](https://travis-ci.org/btcsuite/btcwallet.png?branch=master)](https://travis-ci.org/btcsuite/btcwallet) [![Build Status](https://travis-ci.org/lbryio/lbcwallet.png?branch=master)](https://travis-ci.org/lbryio/lbcwallet)
[![Build status](https://ci.appveyor.com/api/projects/status/88nxvckdj8upqr36/branch/master?svg=true)](https://ci.appveyor.com/project/jrick/btcwallet/branch/master) [![Build status](https://ci.appveyor.com/api/projects/status/88nxvckdj8upqr36/branch/master?svg=true)](https://ci.appveyor.com/project/jrick/lbcwallet/branch/master)
btcwallet is a daemon handling bitcoin wallet functionality for a lbcwallet is a daemon handling bitcoin wallet functionality for a
single user. It acts as both an RPC client to btcd and an RPC server single user. It acts as both an RPC client to and an RPC server
for wallet clients and legacy RPC applications. for wallet clients and legacy RPC applications.
Public and private keys are derived using the hierarchical Public and private keys are derived using the hierarchical
deterministic format described by deterministic format described by
[BIP0032](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki). [BIP0032](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki).
Unencrypted private keys are not supported and are never written to Unencrypted private keys are not supported and are never written to
disk. btcwallet uses the disk. lbcwallet uses the
`m/44'/<coin type>'/<account>'/<branch>/<address index>` `m/44'/<coin type>'/<account>'/<branch>/<address index>`
HD path for all derived addresses, as described by HD path for all derived addresses, as described by
[BIP0044](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki). [BIP0044](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki).
Due to the sensitive nature of public data in a BIP0032 wallet, Due to the sensitive nature of public data in a BIP0032 wallet,
btcwallet provides the option of encrypting not just private keys, but lbcwallet provides the option of encrypting not just private keys, but
public data as well. This is intended to thwart privacy risks where a public data as well. This is intended to thwart privacy risks where a
wallet file is compromised without exposing all current and future wallet file is compromised without exposing all current and future
addresses (public keys) managed by the wallet. While access to this addresses (public keys) managed by the wallet. While access to this
@ -27,11 +27,11 @@ does mean they could track all transactions involving your addresses
and therefore know your exact balance. In a future release, public data and therefore know your exact balance. In a future release, public data
encryption will extend to transactions as well. encryption will extend to transactions as well.
btcwallet is not an SPV client and requires connecting to a local or lbcwallet is not an SPV client and requires connecting to a local or
remote btcd instance for asynchronous blockchain queries and remote instance for asynchronous blockchain queries and
notifications over websockets. Full btcd installation instructions notifications over websockets. Full installation instructions
can be found [here](https://github.com/btcsuite/btcd). An alternative can be found [here](https://github.com/lbryio/lbcd). An alternative
SPV mode that is compatible with btcd and Bitcoin Core is planned for SPV mode that is compatible with and Bitcoin Core is planned for
a future release. a future release.
Wallet clients can use one of two RPC servers: Wallet clients can use one of two RPC servers:
@ -47,7 +47,7 @@ Wallet clients can use one of two RPC servers:
2. An experimental gRPC server 2. An experimental gRPC server
The gRPC server uses a new API built for btcwallet, but the API is not The gRPC server uses a new API built for lbcwallet, but the API is not
stabilized and the server is feature gated behind a config option stabilized and the server is feature gated behind a config option
(`--experimentalrpclisten`). If you don't mind applications breaking due (`--experimentalrpclisten`). If you don't mind applications breaking due
to API changes, don't want to deal with issues of the legacy API, or need to API changes, don't want to deal with issues of the legacy API, or need
@ -64,9 +64,9 @@ Wallet clients can use one of two RPC servers:
Install the latest MSIs available here: Install the latest MSIs available here:
https://github.com/btcsuite/btcd/releases https://github.com/lbryio/lbcd/releases
https://github.com/btcsuite/btcwallet/releases https://github.com/lbryio/lbcwallet/releases
### Windows/Linux/BSD/POSIX - Build from source ### Windows/Linux/BSD/POSIX - Build from source
@ -85,14 +85,14 @@ recommended that `GOPATH` is set to a directory in your home directory such as
`~/goprojects` to avoid write permission issues. It is also recommended to add `~/goprojects` to avoid write permission issues. It is also recommended to add
`$GOPATH/bin` to your `PATH` at this point. `$GOPATH/bin` to your `PATH` at this point.
- Run the following commands to obtain btcwallet, all dependencies, and install it: - Run the following commands to obtain lbcwallet, all dependencies, and install it:
```bash ```bash
$ cd $GOPATH/src/github.com/btcsuite/btcwallet $ cd $GOPATH/src/github.com/lbryio/lbcwallet
$ GO111MODULE=on go install -v . ./cmd/... $ GO111MODULE=on go install -v . ./cmd/...
``` ```
- btcwallet (and utilities) will now be installed in ```$GOPATH/bin```. If you did - lbcwallet (and utilities) will now be installed in ```$GOPATH/bin```. If you did
not already add the bin directory to your system path during Go installation, not already add the bin directory to your system path during Go installation,
we recommend you do so now. we recommend you do so now.
@ -104,75 +104,75 @@ Install a newer MSI
#### Linux/BSD/MacOSX/POSIX - Build from Source #### Linux/BSD/MacOSX/POSIX - Build from Source
- Run the following commands to update btcd, all dependencies, and install it: - Run the following commands to update , all dependencies, and install it:
```bash ```bash
$ cd $GOPATH/src/github.com/btcsuite/btcwallet $ cd $GOPATH/src/github.com/lbryio/lbcwallet
$ git pull $ git pull
$ GO111MODULE=on go install -v . ./cmd/... $ GO111MODULE=on go install -v . ./cmd/...
``` ```
## Getting Started ## Getting Started
The following instructions detail how to get started with btcwallet connecting The following instructions detail how to get started with lbcwallet connecting
to a localhost btcd. Commands should be run in `cmd.exe` or PowerShell on to a localhost . Commands should be run in `cmd.exe` or PowerShell on
Windows, or any terminal emulator on *nix. Windows, or any terminal emulator on *nix.
- Run the following command to start btcd: - Run the following command to start :
``` ```
btcd -u rpcuser -P rpcpass -u rpcuser -P rpcpass
``` ```
- Run the following command to create a wallet: - Run the following command to create a wallet:
``` ```
btcwallet -u rpcuser -P rpcpass --create lbcwallet -u rpcuser -P rpcpass --create
``` ```
- Run the following command to start btcwallet: - Run the following command to start lbcwallet:
``` ```
btcwallet -u rpcuser -P rpcpass lbcwallet -u rpcuser -P rpcpass
``` ```
If everything appears to be working, it is recommended at this point to If everything appears to be working, it is recommended at this point to
copy the sample btcd and btcwallet configurations and update with your copy the sample and lbcwallet configurations and update with your
RPC username and password. RPC username and password.
PowerShell (Installed from MSI): PowerShell (Installed from MSI):
``` ```
PS> cp "$env:ProgramFiles\Btcd Suite\Btcd\sample-btcd.conf" $env:LOCALAPPDATA\Btcd\btcd.conf PS> cp "$env:ProgramFiles\Lbcd Suite\Lbcd\sample-lbcd.conf" $env:LOCALAPPDATA\Lbcd\.conf
PS> cp "$env:ProgramFiles\Btcd Suite\Btcwallet\sample-btcwallet.conf" $env:LOCALAPPDATA\Btcwallet\btcwallet.conf PS> cp "$env:ProgramFiles\Lbcd Suite\lbcwallet\sample-lbcwallet.conf" $env:LOCALAPPDATA\lbcwallet\lbcwallet.conf
PS> $editor $env:LOCALAPPDATA\Btcd\btcd.conf PS> $editor $env:LOCALAPPDATA\Lbcd\lbcd.conf
PS> $editor $env:LOCALAPPDATA\Btcwallet\btcwallet.conf PS> $editor $env:LOCALAPPDATA\lbcwallet\lbcwallet.conf
``` ```
PowerShell (Installed from source): PowerShell (Installed from source):
``` ```
PS> cp $env:GOPATH\src\github.com\btcsuite\btcd\sample-btcd.conf $env:LOCALAPPDATA\Btcd\btcd.conf PS> cp $env:GOPATH\src\github.com\lbryio\lbcd\sample-lbcd.conf $env:LOCALAPPDATA\Lbcd\lbcd.conf
PS> cp $env:GOPATH\src\github.com\btcsuite\btcwallet\sample-btcwallet.conf $env:LOCALAPPDATA\Btcwallet\btcwallet.conf PS> cp $env:GOPATH\src\github.com\lbryio\lbcwallet\sample-lbcwallet.conf $env:LOCALAPPDATA\lbcwallet\lbcwallet.conf
PS> $editor $env:LOCALAPPDATA\Btcd\btcd.conf PS> $editor $env:LOCALAPPDATA\Lbcd\lbcd.conf
PS> $editor $env:LOCALAPPDATA\Btcwallet\btcwallet.conf PS> $editor $env:LOCALAPPDATA\lbcwallet\lbcwallet.conf
``` ```
Linux/BSD/POSIX (Installed from source): Linux/BSD/POSIX (Installed from source):
```bash ```bash
$ cp $GOPATH/src/github.com/btcsuite/btcd/sample-btcd.conf ~/.btcd/btcd.conf $ cp $GOPATH/src/github.com/lbryio/lbcd/sample-.conf ~/./.conf
$ cp $GOPATH/src/github.com/btcsuite/btcwallet/sample-btcwallet.conf ~/.btcwallet/btcwallet.conf $ cp $GOPATH/src/github.com/lbryio/lbcwallet/sample-lbcwallet.conf ~/.lbcwallet/lbcwallet.conf
$ $EDITOR ~/.btcd/btcd.conf $ $EDITOR ~/./.conf
$ $EDITOR ~/.btcwallet/btcwallet.conf $ $EDITOR ~/.lbcwallet/lbcwallet.conf
``` ```
## Issue Tracker ## Issue Tracker
The [integrated github issue tracker](https://github.com/btcsuite/btcwallet/issues) The [integrated github issue tracker](https://github.com/lbryio/lbcwallet/issues)
is used for this project. is used for this project.
## GPG Verification Key ## GPG Verification Key
All official release tags are signed by Conformal so users can ensure the code All official release tags are signed by Conformal so users can ensure the code
has not been tampered with and is coming from the btcsuite developers. To has not been tampered with and is coming from the lbryio developers. To
verify the signature perform the following: verify the signature perform the following:
- Download the public key from the Conformal website at - Download the public key from the Conformal website at
@ -191,4 +191,4 @@ verify the signature perform the following:
## License ## License
btcwallet is licensed under the liberal ISC License. lbcwallet is licensed under the liberal ISC License.

View file

@ -1,11 +1,11 @@
package chain package chain
import ( import (
"github.com/btcsuite/btcd/chaincfg" "github.com/lbryio/lbcd/chaincfg"
"github.com/btcsuite/btcd/txscript" "github.com/lbryio/lbcd/txscript"
"github.com/btcsuite/btcd/wire" "github.com/lbryio/lbcd/wire"
"github.com/btcsuite/btcutil" btcutil "github.com/lbryio/lbcutil"
"github.com/btcsuite/btcwallet/waddrmgr" "github.com/lbryio/lbcwallet/waddrmgr"
) )
// BlockFilterer is used to iteratively scan blocks for a set of addresses of // BlockFilterer is used to iteratively scan blocks for a set of addresses of

View file

@ -5,11 +5,11 @@ import (
"testing" "testing"
"time" "time"
"github.com/btcsuite/btcd/chaincfg" "github.com/lbryio/lbcd/chaincfg"
"github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/lbryio/lbcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire" "github.com/lbryio/lbcd/wire"
"github.com/btcsuite/btcutil" btcutil "github.com/lbryio/lbcutil"
"github.com/btcsuite/btcwallet/chain" "github.com/lbryio/lbcwallet/chain"
) )
var Block100000 = wire.MsgBlock{ var Block100000 = wire.MsgBlock{

View file

@ -3,11 +3,11 @@ package chain
import ( import (
"time" "time"
"github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/lbryio/lbcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire" "github.com/lbryio/lbcd/wire"
"github.com/btcsuite/btcutil" btcutil "github.com/lbryio/lbcutil"
"github.com/btcsuite/btcwallet/waddrmgr" "github.com/lbryio/lbcwallet/waddrmgr"
"github.com/btcsuite/btcwallet/wtxmgr" "github.com/lbryio/lbcwallet/wtxmgr"
) )
// isCurrentDelta is the delta duration we'll use from the present time to // isCurrentDelta is the delta duration we'll use from the present time to
@ -20,12 +20,12 @@ const isCurrentDelta = 2 * time.Hour
func BackEnds() []string { func BackEnds() []string {
return []string{ return []string{
"bitcoind", "bitcoind",
"btcd", "",
} }
} }
// Interface allows more than one backing blockchain source, such as a // Interface allows more than one backing blockchain source, such as a
// btcd RPC chain server, or an SPV library, as long as we write a driver for // RPC chain server, or an SPV library, as long as we write a driver for
// it. // it.
type Interface interface { type Interface interface {
Start() error Start() error

View file

@ -1,7 +1,7 @@
package chain package chain
import ( import (
"github.com/btcsuite/btcd/txscript" "github.com/lbryio/lbcd/txscript"
) )
// buildFilterBlocksWatchList constructs a watchlist used for matching against a // buildFilterBlocksWatchList constructs a watchlist used for matching against a

View file

@ -9,16 +9,16 @@ import (
"sync" "sync"
"time" "time"
"github.com/btcsuite/btcd/btcjson" "github.com/lbryio/lbcd/btcjson"
"github.com/btcsuite/btcd/chaincfg" "github.com/lbryio/lbcd/chaincfg"
"github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/lbryio/lbcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/rpcclient" "github.com/lbryio/lbcd/rpcclient"
"github.com/btcsuite/btcd/wire" "github.com/lbryio/lbcd/wire"
"github.com/btcsuite/btcutil" btcutil "github.com/lbryio/lbcutil"
"github.com/btcsuite/btcutil/gcs" "github.com/lbryio/lbcutil/gcs"
"github.com/btcsuite/btcutil/gcs/builder" "github.com/lbryio/lbcutil/gcs/builder"
"github.com/btcsuite/btcwallet/waddrmgr" "github.com/lbryio/lbcwallet/waddrmgr"
"github.com/btcsuite/btcwallet/wtxmgr" "github.com/lbryio/lbcwallet/wtxmgr"
) )
// RPCClient represents a persistent client connection to a bitcoin RPC server // RPCClient represents a persistent client connection to a bitcoin RPC server
@ -89,7 +89,7 @@ func NewRPCClient(chainParams *chaincfg.Params, connect, user, pass string, cert
// BackEnd returns the name of the driver. // BackEnd returns the name of the driver.
func (c *RPCClient) BackEnd() string { func (c *RPCClient) BackEnd() string {
return "btcd" return ""
} }
// Start attempts to establish a client connection with the remote server. // Start attempts to establish a client connection with the remote server.

View file

@ -9,10 +9,10 @@ import (
"sync" "sync"
"time" "time"
"github.com/btcsuite/btcd/blockchain" "github.com/lbryio/lbcd/blockchain"
"github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/lbryio/lbcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire" "github.com/lbryio/lbcd/wire"
"github.com/btcsuite/btcutil" btcutil "github.com/lbryio/lbcutil"
) )
// conn mocks a network connection by implementing the net.Conn interface. It is // conn mocks a network connection by implementing the net.Conn interface. It is
@ -63,7 +63,7 @@ func pipe(c1, c2 *conn) (*conn, *conn) {
// returns the root of the tree. // returns the root of the tree.
// //
// This function was copied from: // This function was copied from:
// https://github.com/btcsuite/btcd/blob/36a96f6a0025b6aeaebe4106821c2d46ee4be8d4/blockchain/fullblocktests/generate.go#L303 // https://github.com/lbryio/lbcd/blob/36a96f6a0025b6aeaebe4106821c2d46ee4be8d4/blockchain/fullblocktests/generate.go#L303
func calcMerkleRoot(txns []*wire.MsgTx) chainhash.Hash { func calcMerkleRoot(txns []*wire.MsgTx) chainhash.Hash {
if len(txns) == 0 { if len(txns) == 0 {
return chainhash.Hash{} return chainhash.Hash{}
@ -83,7 +83,7 @@ func calcMerkleRoot(txns []*wire.MsgTx) chainhash.Hash {
// with the solution. False is returned if no solution exists. // with the solution. False is returned if no solution exists.
// //
// This function was copied from: // This function was copied from:
// https://github.com/btcsuite/btcd/blob/36a96f6a0025b6aeaebe4106821c2d46ee4be8d4/blockchain/fullblocktests/generate.go#L324 // https://github.com/lbryio/lbcd/blob/36a96f6a0025b6aeaebe4106821c2d46ee4be8d4/blockchain/fullblocktests/generate.go#L324
func solveBlock(header *wire.BlockHeader) bool { func solveBlock(header *wire.BlockHeader) bool {
// sbResult is used by the solver goroutines to send results. // sbResult is used by the solver goroutines to send results.
type sbResult struct { type sbResult struct {

View file

@ -11,17 +11,17 @@ import (
"path/filepath" "path/filepath"
"time" "time"
"github.com/btcsuite/btcutil"
"github.com/btcsuite/btcwallet/wallet"
"github.com/btcsuite/btcwallet/walletdb"
_ "github.com/btcsuite/btcwallet/walletdb/bdb"
"github.com/jessevdk/go-flags" "github.com/jessevdk/go-flags"
btcutil "github.com/lbryio/lbcutil"
"github.com/lbryio/lbcwallet/wallet"
"github.com/lbryio/lbcwallet/walletdb"
_ "github.com/lbryio/lbcwallet/walletdb/bdb"
) )
const defaultNet = "mainnet" const defaultNet = "mainnet"
var ( var (
datadir = btcutil.AppDataDir("btcwallet", false) datadir = btcutil.AppDataDir("lbcwallet", false)
) )
// Flags. // Flags.
@ -74,7 +74,7 @@ func mainInt() int {
} }
for !opts.Force { for !opts.Force {
fmt.Print("Drop all btcwallet transaction history? [y/N] ") fmt.Print("Drop all lbcwallet transaction history? [y/N] ")
scanner := bufio.NewScanner(bufio.NewReader(os.Stdin)) scanner := bufio.NewScanner(bufio.NewReader(os.Stdin))
if !scanner.Scan() { if !scanner.Scan() {
@ -105,7 +105,7 @@ func mainInt() int {
} }
defer db.Close() defer db.Close()
fmt.Println("Dropping btcwallet transaction history") fmt.Println("Dropping lbcwallet transaction history")
err = wallet.DropTransactionHistory(db, !opts.DropLabels) err = wallet.DropTransactionHistory(db, !opts.DropLabels)
if err != nil { if err != nil {

View file

@ -12,22 +12,22 @@ import (
"golang.org/x/crypto/ssh/terminal" "golang.org/x/crypto/ssh/terminal"
"github.com/btcsuite/btcd/btcjson"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/rpcclient"
"github.com/btcsuite/btcd/txscript"
"github.com/btcsuite/btcd/wire"
"github.com/btcsuite/btcutil"
"github.com/btcsuite/btcwallet/internal/cfgutil"
"github.com/btcsuite/btcwallet/netparams"
"github.com/btcsuite/btcwallet/wallet/txauthor"
"github.com/btcsuite/btcwallet/wallet/txrules"
"github.com/btcsuite/btcwallet/wallet/txsizes"
"github.com/jessevdk/go-flags" "github.com/jessevdk/go-flags"
"github.com/lbryio/lbcd/btcjson"
"github.com/lbryio/lbcd/chaincfg/chainhash"
"github.com/lbryio/lbcd/rpcclient"
"github.com/lbryio/lbcd/txscript"
"github.com/lbryio/lbcd/wire"
btcutil "github.com/lbryio/lbcutil"
"github.com/lbryio/lbcwallet/internal/cfgutil"
"github.com/lbryio/lbcwallet/netparams"
"github.com/lbryio/lbcwallet/wallet/txauthor"
"github.com/lbryio/lbcwallet/wallet/txrules"
"github.com/lbryio/lbcwallet/wallet/txsizes"
) )
var ( var (
walletDataDirectory = btcutil.AppDataDir("btcwallet", false) walletDataDirectory = btcutil.AppDataDir("lbcwallet", false)
newlineBytes = []byte{'\n'} newlineBytes = []byte{'\n'}
) )

View file

@ -16,28 +16,28 @@ import (
"strings" "strings"
"time" "time"
"github.com/btcsuite/btcd/chaincfg"
"github.com/btcsuite/btcutil"
"github.com/btcsuite/btcwallet/internal/cfgutil"
"github.com/btcsuite/btcwallet/internal/legacy/keystore"
"github.com/btcsuite/btcwallet/netparams"
"github.com/btcsuite/btcwallet/wallet"
flags "github.com/jessevdk/go-flags" flags "github.com/jessevdk/go-flags"
"github.com/lbryio/lbcd/chaincfg"
btcutil "github.com/lbryio/lbcutil"
"github.com/lbryio/lbcwallet/internal/cfgutil"
"github.com/lbryio/lbcwallet/internal/legacy/keystore"
"github.com/lbryio/lbcwallet/netparams"
"github.com/lbryio/lbcwallet/wallet"
) )
const ( const (
defaultCAFilename = "btcd.cert" defaultCAFilename = "lbcd.cert"
defaultConfigFilename = "btcwallet.conf" defaultConfigFilename = "lbcwallet.conf"
defaultLogLevel = "info" defaultLogLevel = "info"
defaultLogDirname = "logs" defaultLogDirname = "logs"
defaultLogFilename = "btcwallet.log" defaultLogFilename = "lbcwallet.log"
defaultRPCMaxClients = 10 defaultRPCMaxClients = 10
defaultRPCMaxWebsockets = 25 defaultRPCMaxWebsockets = 25
) )
var ( var (
btcdDefaultCAFile = filepath.Join(btcutil.AppDataDir("btcd", false), "rpc.cert") lbcdDefaultCAFile = filepath.Join(btcutil.AppDataDir("lbcd", false), "rpc.cert")
defaultAppDataDir = btcutil.AppDataDir("btcwallet", false) defaultAppDataDir = btcutil.AppDataDir("lbcwallet", false)
defaultConfigFile = filepath.Join(defaultAppDataDir, defaultConfigFilename) defaultConfigFile = filepath.Join(defaultAppDataDir, defaultConfigFilename)
defaultRPCKeyFile = filepath.Join(defaultAppDataDir, "rpc.key") defaultRPCKeyFile = filepath.Join(defaultAppDataDir, "rpc.key")
defaultRPCCertFile = filepath.Join(defaultAppDataDir, "rpc.cert") defaultRPCCertFile = filepath.Join(defaultAppDataDir, "rpc.cert")
@ -66,11 +66,11 @@ type config struct {
WalletPass string `long:"walletpass" default-mask:"-" description:"The public wallet password -- Only required if the wallet was created with one"` WalletPass string `long:"walletpass" default-mask:"-" description:"The public wallet password -- Only required if the wallet was created with one"`
// RPC client options // RPC client options
RPCConnect string `short:"c" long:"rpcconnect" description:"Hostname/IP and port of btcd RPC server to connect to (default localhost:8334, testnet: localhost:18334, simnet: localhost:18556)"` RPCConnect string `short:"c" long:"rpcconnect" description:"Hostname/IP and port of lbcd RPC server to connect to (default localhost:8334, testnet: localhost:18334, simnet: localhost:18556)"`
CAFile *cfgutil.ExplicitString `long:"cafile" description:"File containing root certificates to authenticate a TLS connections with btcd"` CAFile *cfgutil.ExplicitString `long:"cafile" description:"File containing root certificates to authenticate a TLS connections with lbcd"`
DisableClientTLS bool `long:"noclienttls" description:"Disable TLS for the RPC client -- NOTE: This is only allowed if the RPC client is connecting to localhost"` DisableClientTLS bool `long:"noclienttls" description:"Disable TLS for the RPC client -- NOTE: This is only allowed if the RPC client is connecting to localhost"`
BtcdUsername string `long:"btcdusername" description:"Username for btcd authentication"` LbcdUsername string `long:"lbcdusername" description:"Username for lbcd authentication"`
BtcdPassword string `long:"btcdpassword" default-mask:"-" description:"Password for btcd authentication"` LbcdPassword string `long:"lbcdpassword" default-mask:"-" description:"Password for lbcd authentication"`
Proxy string `long:"proxy" description:"Connect via SOCKS5 proxy (eg. 127.0.0.1:9050)"` Proxy string `long:"proxy" description:"Connect via SOCKS5 proxy (eg. 127.0.0.1:9050)"`
ProxyUser string `long:"proxyuser" description:"Username for proxy server"` ProxyUser string `long:"proxyuser" description:"Username for proxy server"`
ProxyPass string `long:"proxypass" default-mask:"-" description:"Password for proxy server"` ProxyPass string `long:"proxypass" default-mask:"-" description:"Password for proxy server"`
@ -98,8 +98,8 @@ type config struct {
LegacyRPCListeners []string `long:"rpclisten" description:"Listen for legacy RPC connections on this interface/port (default port: 8332, testnet: 18332, simnet: 18554)"` LegacyRPCListeners []string `long:"rpclisten" description:"Listen for legacy RPC connections on this interface/port (default port: 8332, testnet: 18332, simnet: 18554)"`
LegacyRPCMaxClients int64 `long:"rpcmaxclients" description:"Max number of legacy RPC clients for standard connections"` LegacyRPCMaxClients int64 `long:"rpcmaxclients" description:"Max number of legacy RPC clients for standard connections"`
LegacyRPCMaxWebsockets int64 `long:"rpcmaxwebsockets" description:"Max number of legacy RPC websocket connections"` LegacyRPCMaxWebsockets int64 `long:"rpcmaxwebsockets" description:"Max number of legacy RPC websocket connections"`
Username string `short:"u" long:"username" description:"Username for legacy RPC and btcd authentication (if btcdusername is unset)"` Username string `short:"u" long:"username" description:"Username for legacy RPC and lbcd authentication (if lbcdusername is unset)"`
Password string `short:"P" long:"password" default-mask:"-" description:"Password for legacy RPC and btcd authentication (if btcdpassword is unset)"` Password string `short:"P" long:"password" default-mask:"-" description:"Password for legacy RPC and lbcd authentication (if lbcdpassword is unset)"`
// EXPERIMENTAL RPC server options // EXPERIMENTAL RPC server options
// //
@ -253,7 +253,7 @@ func parseAndSetDebugLevels(debugLevel string) error {
// 3) Load configuration file overwriting defaults with any specified options // 3) Load configuration file overwriting defaults with any specified options
// 4) Parse CLI options and overwrite/add any specified options // 4) Parse CLI options and overwrite/add any specified options
// //
// The above results in btcwallet functioning properly without any config // The above results in lbcwallet functioning properly without any config
// settings while still allowing the user to override settings with config files // settings while still allowing the user to override settings with config files
// and command line options. Command line options always take precedence. // and command line options. Command line options always take precedence.
func loadConfig() (*config, []string, error) { func loadConfig() (*config, []string, error) {
@ -569,12 +569,12 @@ func loadConfig() (*config, []string, error) {
return nil, nil, err return nil, nil, err
} }
} else { } else {
// If CAFile is unset, choose either the copy or local btcd cert. // If CAFile is unset, choose either the copy or local lbcd cert.
if !cfg.CAFile.ExplicitlySet() { if !cfg.CAFile.ExplicitlySet() {
cfg.CAFile.Value = filepath.Join(cfg.AppDataDir.Value, defaultCAFilename) cfg.CAFile.Value = filepath.Join(cfg.AppDataDir.Value, defaultCAFilename)
// If the CA copy does not exist, check if we're connecting to // If the CA copy does not exist, check if we're connecting to
// a local btcd and switch to its RPC cert if it exists. // a local lbcd and switch to its RPC cert if it exists.
certExists, err := cfgutil.FileExists(cfg.CAFile.Value) certExists, err := cfgutil.FileExists(cfg.CAFile.Value)
if err != nil { if err != nil {
fmt.Fprintln(os.Stderr, err) fmt.Fprintln(os.Stderr, err)
@ -582,14 +582,14 @@ func loadConfig() (*config, []string, error) {
} }
if !certExists { if !certExists {
if _, ok := localhostListeners[RPCHost]; ok { if _, ok := localhostListeners[RPCHost]; ok {
btcdCertExists, err := cfgutil.FileExists( lbcdCertExists, err := cfgutil.FileExists(
btcdDefaultCAFile) lbcdDefaultCAFile)
if err != nil { if err != nil {
fmt.Fprintln(os.Stderr, err) fmt.Fprintln(os.Stderr, err)
return nil, nil, err return nil, nil, err
} }
if btcdCertExists { if lbcdCertExists {
cfg.CAFile.Value = btcdDefaultCAFile cfg.CAFile.Value = lbcdDefaultCAFile
} }
} }
} }
@ -680,15 +680,15 @@ func loadConfig() (*config, []string, error) {
cfg.RPCCert.Value = cleanAndExpandPath(cfg.RPCCert.Value) cfg.RPCCert.Value = cleanAndExpandPath(cfg.RPCCert.Value)
cfg.RPCKey.Value = cleanAndExpandPath(cfg.RPCKey.Value) cfg.RPCKey.Value = cleanAndExpandPath(cfg.RPCKey.Value)
// If the btcd username or password are unset, use the same auth as for // If the lbcd username or password are unset, use the same auth as for
// the client. The two settings were previously shared for btcd and // the client. The two settings were previously shared for lbcd and
// client auth, so this avoids breaking backwards compatibility while // client auth, so this avoids breaking backwards compatibility while
// allowing users to use different auth settings for btcd and wallet. // allowing users to use different auth settings for lbcd and wallet.
if cfg.BtcdUsername == "" { if cfg.LbcdUsername == "" {
cfg.BtcdUsername = cfg.Username cfg.LbcdUsername = cfg.Username
} }
if cfg.BtcdPassword == "" { if cfg.LbcdPassword == "" {
cfg.BtcdPassword = cfg.Password cfg.LbcdPassword = cfg.Password
} }
// Warn about missing config file after the final command line parse // Warn about missing config file after the final command line parse

View file

@ -1,10 +1,10 @@
Dependency Commits Dependency Commits
================== ==================
btcwallet 0.7.0 Alpha lbcwallet 0.7.0 Alpha
---------------- ----------------
bolt 1139dd23c5f9d1a28096b511959044b29364a3fe bolt 1139dd23c5f9d1a28096b511959044b29364a3fe
btcd cea5d3c1cc16eb07a1686c557db23004655ae11b cea5d3c1cc16eb07a1686c557db23004655ae11b
btclog 5005b7240f310ae8f01c7664a3954d280241eb2b btclog 5005b7240f310ae8f01c7664a3954d280241eb2b
btcrpcclient b81555beeac8eda71e8150cc9d63631aaa756965 btcrpcclient b81555beeac8eda71e8150cc9d63631aaa756965
btcutil ff82dacded1c76d101bce55c394c03c0bbff69e8 btcutil ff82dacded1c76d101bce55c394c03c0bbff69e8
@ -15,9 +15,9 @@ golangcrypto 53f62d9b43e87a6c56975cf862af7edf33a8d0df
seelog 313961b101eb55f65ae0f03ddd4e322731763b6c seelog 313961b101eb55f65ae0f03ddd4e322731763b6c
websocket 31079b6807923eb23992c421b114992b95131b55 websocket 31079b6807923eb23992c421b114992b95131b55
btcwallet 0.1.0 Alpha lbcwallet 0.1.0 Alpha
---------------- ----------------
btcd 3108b944017b14a3c5863ed1401f1a2471907d84 3108b944017b14a3c5863ed1401f1a2471907d84
btcec a97fd5fe2c670030f8d77dc13b9fa8401ef9f349 btcec a97fd5fe2c670030f8d77dc13b9fa8401ef9f349
btcjson d20f958c92e1444d83215c3cf98d6eef41898dcb btcjson d20f958c92e1444d83215c3cf98d6eef41898dcb
btcscript f4a6449ad3b90d0c830bf2895b83ced8d5fb91e9 btcscript f4a6449ad3b90d0c830bf2895b83ced8d5fb91e9

View file

@ -1,3 +1,3 @@
### Guides ### Guides
[Rebuilding all transaction history with forced rescans](https://github.com/btcsuite/btcwallet/tree/master/docs/force_rescans.md) [Rebuilding all transaction history with forced rescans](https://github.com/lbryio/lbcwallet/tree/master/docs/force_rescans.md)

View file

@ -33,14 +33,14 @@ two situations when this holds true:
The second case is how a forced rescan is performed. The second case is how a forced rescan is performed.
btcwallet will not drop transaction history by itself, as this is something that lbcwallet will not drop transaction history by itself, as this is something that
should not be necessary under normal wallet operation. However, a tool, should not be necessary under normal wallet operation. However, a tool,
`dropwtxmgr`, is provided in the `cmd/dropwtxmgr` directory which may be used to `dropwtxmgr`, is provided in the `cmd/dropwtxmgr` directory which may be used to
drop the wallet transaction manager (wtxmgr) history from a wallet database. drop the wallet transaction manager (wtxmgr) history from a wallet database.
The tool may already be installed in your PATH, but if not, installing it is easy: The tool may already be installed in your PATH, but if not, installing it is easy:
``` ```
$ cd $GOPATH/src/github.com/btcsuite/btcwallet/cmd/dropwtxmgr $ cd $GOPATH/src/github.com/lbryio/lbcwallet/cmd/dropwtxmgr
$ go get $ go get
``` ```
@ -50,8 +50,8 @@ answering yes to the prompt:
``` ```
$ dropwtxmgr $ dropwtxmgr
Database path: /home/username/.btcwallet/mainnet/wallet.db Database path: /home/username/.lbcwallet/mainnet/wallet.db
Drop all btcwallet transaction history? [y/N] y Drop all lbcwallet transaction history? [y/N] y
Dropping wtxmgr namespace Dropping wtxmgr namespace
``` ```
@ -60,17 +60,17 @@ different network (e.g. testnet or simnet) must be dropped, the full database
path may be specified: path may be specified:
``` ```
$ dropwtxmgr --db ~/.btcwallet/testnet/wallet.db $ dropwtxmgr --db ~/.lbcwallet/testnet/wallet.db
Database path: /home/username/.btcwallet/testnet/wallet.db Database path: /home/username/.lbcwallet/testnet/wallet.db
Drop all btcwallet transaction history? [y/N] y Drop all lbcwallet transaction history? [y/N] y
Dropping wtxmgr namespace Dropping wtxmgr namespace
``` ```
After dropping transaction history, btcwallet may be restarted and a full rescan After dropping transaction history, lbcwallet may be restarted and a full rescan
will be triggered to sync the wallet: will be triggered to sync the wallet:
``` ```
$ btcwallet $ lbcwallet
14:05:31 2015-04-13 [INF] BTCW: No recorded transaction history -- needs full rescan 14:05:31 2015-04-13 [INF] BTCW: No recorded transaction history -- needs full rescan
... ...
14:05:31 2015-04-13 [INF] WLLT: Started rescan from block 000000000000e37b0f99af2e434834123b5459e31e17937169ce81ed0cc4d61c (height 193191) for 1 address 14:05:31 2015-04-13 [INF] WLLT: Started rescan from block 000000000000e37b0f99af2e434834123b5459e31e17937169ce81ed0cc4d61c (height 193191) for 1 address

View file

@ -7,7 +7,7 @@
set -ex set -ex
test_targets=$(go list -deps ./... | grep 'btcwallet') test_targets=$(go list -deps ./... | grep 'lbcwallet')
# Automatic checks # Automatic checks
test -z "$(go fmt $test_targets | tee /dev/stderr)" test -z "$(go fmt $test_targets | tee /dev/stderr)"

View file

@ -8,7 +8,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/btcsuite/btcutil" btcutil "github.com/lbryio/lbcutil"
) )
// AmountFlag embeds a btcutil.Amount and implements the flags.Marshaler and // AmountFlag embeds a btcutil.Amount and implements the flags.Marshaler and
@ -29,7 +29,7 @@ func (a *AmountFlag) MarshalFlag() (string, error) {
// UnmarshalFlag satisfies the flags.Unmarshaler interface. // UnmarshalFlag satisfies the flags.Unmarshaler interface.
func (a *AmountFlag) UnmarshalFlag(value string) error { func (a *AmountFlag) UnmarshalFlag(value string) error {
value = strings.TrimSuffix(value, " BTC") value = strings.TrimSuffix(value, " LBC")
valueF64, err := strconv.ParseFloat(value, 64) valueF64, err := strconv.ParseFloat(value, 64)
if err != nil { if err != nil {
return err return err

View file

@ -24,13 +24,13 @@ import (
"golang.org/x/crypto/ripemd160" "golang.org/x/crypto/ripemd160"
"github.com/btcsuite/btcd/btcec" "github.com/lbryio/lbcd/btcec"
"github.com/btcsuite/btcd/chaincfg" "github.com/lbryio/lbcd/chaincfg"
"github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/lbryio/lbcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/txscript" "github.com/lbryio/lbcd/txscript"
"github.com/btcsuite/btcd/wire" "github.com/lbryio/lbcd/wire"
"github.com/btcsuite/btcutil" btcutil "github.com/lbryio/lbcutil"
"github.com/btcsuite/btcwallet/internal/legacy/rename" "github.com/lbryio/lbcwallet/internal/legacy/rename"
) )
const ( const (
@ -1731,7 +1731,7 @@ func (af *addrFlags) ReadFrom(r io.Reader) (int64, error) {
af.partialSync = b[0]&(1<<7) != 0 af.partialSync = b[0]&(1<<7) != 0
// Currently (at least until watching-only key stores are implemented) // Currently (at least until watching-only key stores are implemented)
// btcwallet shall refuse to open any unencrypted addresses. This // lbcwallet shall refuse to open any unencrypted addresses. This
// check only makes sense if there is a private key to encrypt, which // check only makes sense if there is a private key to encrypt, which
// there may not be if the keypool was extended from just the last // there may not be if the keypool was extended from just the last
// public key and no private keys were written. // public key and no private keys were written.
@ -1971,7 +1971,7 @@ func (it *BlockIterator) BlockStamp() BlockStamp {
} }
// unusedSpace is a wrapper type to read or write one or more types // unusedSpace is a wrapper type to read or write one or more types
// that btcwallet fits into an unused space left by Armory's key store file // that lbcwallet fits into an unused space left by Armory's key store file
// format. // format.
type unusedSpace struct { type unusedSpace struct {
nBytes int // number of unused bytes that armory left. nBytes int // number of unused bytes that armory left.

View file

@ -11,12 +11,12 @@ import (
"reflect" "reflect"
"testing" "testing"
"github.com/btcsuite/btcd/btcec"
"github.com/btcsuite/btcd/chaincfg"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/txscript"
"github.com/btcsuite/btcutil"
"github.com/davecgh/go-spew/spew" "github.com/davecgh/go-spew/spew"
"github.com/lbryio/lbcd/btcec"
"github.com/lbryio/lbcd/chaincfg"
"github.com/lbryio/lbcd/chaincfg/chainhash"
"github.com/lbryio/lbcd/txscript"
btcutil "github.com/lbryio/lbcutil"
) )
const dummyDir = "" const dummyDir = ""

View file

@ -15,8 +15,8 @@ import (
"os" "os"
"strings" "strings"
"github.com/btcsuite/btcutil/hdkeychain" "github.com/lbryio/lbcutil/hdkeychain"
"github.com/btcsuite/btcwallet/internal/legacy/keystore" "github.com/lbryio/lbcwallet/internal/legacy/keystore"
"golang.org/x/crypto/ssh/terminal" "golang.org/x/crypto/ssh/terminal"
) )

View file

@ -8,7 +8,7 @@ import (
"bufio" "bufio"
"fmt" "fmt"
"github.com/btcsuite/btcwallet/internal/legacy/keystore" "github.com/lbryio/lbcwallet/internal/legacy/keystore"
) )
func ProvideSeed() ([]byte, error) { func ProvideSeed() ([]byte, error) {

View file

@ -13,8 +13,8 @@ import (
"os" "os"
"strings" "strings"
"github.com/btcsuite/btcd/btcjson" "github.com/lbryio/lbcd/btcjson"
"github.com/btcsuite/btcwallet/internal/rpchelp" "github.com/lbryio/lbcwallet/internal/rpchelp"
) )
var outputFile = func() *os.File { var outputFile = func() *os.File {

View file

@ -74,7 +74,7 @@ var helpDescsEnUS = map[string]string{
"infowalletresult-proxy": "The proxy used by the server", "infowalletresult-proxy": "The proxy used by the server",
"infowalletresult-difficulty": "The current target difficulty", "infowalletresult-difficulty": "The current target difficulty",
"infowalletresult-testnet": "Whether or not server is using testnet", "infowalletresult-testnet": "Whether or not server is using testnet",
"infowalletresult-relayfee": "The minimum relay fee for non-free transactions in BTC/KB", "infowalletresult-relayfee": "The minimum relay fee for non-free transactions in LBC/KB",
"infowalletresult-errors": "Any current errors", "infowalletresult-errors": "Any current errors",
"infowalletresult-paytxfee": "The increment used each time more fee is required for an authored transaction", "infowalletresult-paytxfee": "The increment used each time more fee is required for an authored transaction",
"infowalletresult-balance": "The balance of all accounts calculated with one block confirmation", "infowalletresult-balance": "The balance of all accounts calculated with one block confirmation",

View file

@ -7,7 +7,7 @@
package rpchelp package rpchelp
import "github.com/btcsuite/btcd/btcjson" import "github.com/lbryio/lbcd/btcjson"
// Common return types. // Common return types.
var ( var (

View file

@ -7,7 +7,7 @@ package zero_test
import ( import (
"testing" "testing"
. "github.com/btcsuite/btcwallet/internal/zero" . "github.com/lbryio/lbcwallet/internal/zero"
) )
var ( var (

View file

@ -10,7 +10,7 @@ import (
"strings" "strings"
"testing" "testing"
. "github.com/btcsuite/btcwallet/internal/zero" . "github.com/lbryio/lbcwallet/internal/zero"
) )
func makeOneBytes(n int) []byte { func makeOneBytes(n int) []byte {

View file

@ -13,9 +13,9 @@ import (
"runtime" "runtime"
"sync" "sync"
"github.com/btcsuite/btcwallet/chain" "github.com/lbryio/lbcwallet/chain"
"github.com/btcsuite/btcwallet/rpc/legacyrpc" "github.com/lbryio/lbcwallet/rpc/legacyrpc"
"github.com/btcsuite/btcwallet/wallet" "github.com/lbryio/lbcwallet/wallet"
) )
var ( var (
@ -225,14 +225,14 @@ func readCAFile() []byte {
return certs return certs
} }
// startChainRPC opens a RPC client connection to a btcd server for blockchain // startChainRPC opens a RPC client connection to a server for blockchain
// services. This function uses the RPC options from the global config and // services. This function uses the RPC options from the global config and
// there is no recovery in case the server is not available or if there is an // there is no recovery in case the server is not available or if there is an
// authentication error. Instead, all requests to the client will simply error. // authentication error. Instead, all requests to the client will simply error.
func startChainRPC(certs []byte) (*chain.RPCClient, error) { func startChainRPC(certs []byte) (*chain.RPCClient, error) {
log.Infof("Attempting RPC client connection to %v", cfg.RPCConnect) log.Infof("Attempting RPC client connection to %v", cfg.RPCConnect)
rpcc, err := chain.NewRPCClient(activeNet.Params, cfg.RPCConnect, rpcc, err := chain.NewRPCClient(activeNet.Params, cfg.RPCConnect,
cfg.BtcdUsername, cfg.BtcdPassword, certs, cfg.DisableClientTLS, 0) cfg.LbcdUsername, cfg.LbcdPassword, certs, cfg.DisableClientTLS, 0)
if err != nil { if err != nil {
return nil, err return nil, err
} }

12
log.go
View file

@ -10,14 +10,14 @@ import (
"os" "os"
"path/filepath" "path/filepath"
"github.com/btcsuite/btcd/rpcclient"
"github.com/btcsuite/btclog" "github.com/btcsuite/btclog"
"github.com/btcsuite/btcwallet/chain"
"github.com/btcsuite/btcwallet/rpc/legacyrpc"
"github.com/btcsuite/btcwallet/rpc/rpcserver"
"github.com/btcsuite/btcwallet/wallet"
"github.com/btcsuite/btcwallet/wtxmgr"
"github.com/jrick/logrotate/rotator" "github.com/jrick/logrotate/rotator"
"github.com/lbryio/lbcd/rpcclient"
"github.com/lbryio/lbcwallet/chain"
"github.com/lbryio/lbcwallet/rpc/legacyrpc"
"github.com/lbryio/lbcwallet/rpc/rpcserver"
"github.com/lbryio/lbcwallet/wallet"
"github.com/lbryio/lbcwallet/wtxmgr"
) )
// logWriter implements an io.Writer that outputs to both standard output and // logWriter implements an io.Writer that outputs to both standard output and

View file

@ -5,8 +5,8 @@
package netparams package netparams
import ( import (
"github.com/btcsuite/btcd/chaincfg" "github.com/lbryio/lbcd/chaincfg"
"github.com/btcsuite/btcd/wire" "github.com/lbryio/lbcd/wire"
) )
// Params is used to group parameters for various networks such as the main // Params is used to group parameters for various networks such as the main
@ -17,16 +17,16 @@ type Params struct {
RPCServerPort string RPCServerPort string
} }
// MainNetParams contains parameters specific running btcwallet and // MainNetParams contains parameters specific running lbcwallet and
// btcd on the main network (wire.MainNet). // on the main network (wire.MainNet).
var MainNetParams = Params{ var MainNetParams = Params{
Params: &chaincfg.MainNetParams, Params: &chaincfg.MainNetParams,
RPCClientPort: "8334", RPCClientPort: "8334",
RPCServerPort: "8332", RPCServerPort: "8332",
} }
// TestNet3Params contains parameters specific running btcwallet and // TestNet3Params contains parameters specific running lbcwallet and
// btcd on the test network (version 3) (wire.TestNet3). // on the test network (version 3) (wire.TestNet3).
var TestNet3Params = Params{ var TestNet3Params = Params{
Params: &chaincfg.TestNet3Params, Params: &chaincfg.TestNet3Params,
RPCClientPort: "18334", RPCClientPort: "18334",

View file

@ -4,6 +4,6 @@
package main package main
import "github.com/btcsuite/btcwallet/netparams" import "github.com/lbryio/lbcwallet/netparams"
var activeNet = &netparams.MainNetParams var activeNet = &netparams.MainNetParams

View file

@ -212,14 +212,14 @@ ___
#### `StartConsensusRpc` #### `StartConsensusRpc`
The `StartConsensusRpc` method is used to provide clients the ability to dynamically The `StartConsensusRpc` method is used to provide clients the ability to dynamically
start the btcd RPC client. This RPC client is used for wallet syncing and start the RPC client. This RPC client is used for wallet syncing and
publishing transactions to the Bitcoin network. publishing transactions to the Bitcoin network.
**Request:** `StartConsensusRpcRequest` **Request:** `StartConsensusRpcRequest`
- `string network_address`: The host/IP and optional port of the RPC server to - `string network_address`: The host/IP and optional port of the RPC server to
connect to. IP addresses may be IPv4 or IPv6. If the port is missing, a connect to. IP addresses may be IPv4 or IPv6. If the port is missing, a
default port is chosen corresponding to the default btcd RPC port of the default port is chosen corresponding to the default RPC port of the
active Bitcoin network. active Bitcoin network.
- `string username`: The RPC username required to authenticate to the RPC - `string username`: The RPC username required to authenticate to the RPC
@ -259,23 +259,39 @@ or opened yet.
The service provides the following methods: The service provides the following methods:
- [`Ping`](#ping) - [RPC API Specification](#rpc-api-specification)
- [`Network`](#network) - [Version: 2.0.1](#version-201)
- [`AccountNumber`](#accountnumber) - [`VersionService`](#versionservice)
- [`Accounts`](#accounts) - [Methods](#methods)
- [`Balance`](#balance) - [`Version`](#version)
- [`GetTransactions`](#gettransactions) - [`LoaderService`](#loaderservice)
- [`ChangePassphrase`](#changepassphrase) - [Methods](#methods-1)
- [`RenameAccount`](#renameaccount) - [`WalletExists`](#walletexists)
- [`NextAccount`](#nextaccount) - [`CreateWallet`](#createwallet)
- [`NextAddress`](#nextaddress) - [`OpenWallet`](#openwallet)
- [`ImportPrivateKey`](#importprivatekey) - [`CloseWallet`](#closewallet)
- [`FundTransaction`](#fundtransaction) - [`StartConsensusRpc`](#startconsensusrpc)
- [`SignTransaction`](#signtransaction) - [`WalletService`](#walletservice)
- [`PublishTransaction`](#publishtransaction) - [`Ping`](#ping)
- [`TransactionNotifications`](#transactionnotifications) - [`Network`](#network)
- [`SpentnessNotifications`](#spentnessnotifications) - [`AccountNumber`](#accountnumber)
- [`AccountNotifications`](#accountnotifications) - [`Accounts`](#accounts)
- [`Balance`](#balance)
- [`GetTransactions`](#gettransactions)
- [`ChangePassphrase`](#changepassphrase)
- [`RenameAccount`](#renameaccount)
- [`NextAccount`](#nextaccount)
- [`NextAddress`](#nextaddress)
- [`ImportPrivateKey`](#importprivatekey)
- [`FundTransaction`](#fundtransaction)
- [`SignTransaction`](#signtransaction)
- [`PublishTransaction`](#publishtransaction)
- [`TransactionNotifications`](#transactionnotifications)
- [`SpentnessNotifications`](#spentnessnotifications)
- [`AccountNotifications`](#accountnotifications)
- [Shared messages](#shared-messages)
- [`BlockDetails`](#blockdetails)
- [`TransactionDetails`](#transactiondetails)
#### `Ping` #### `Ping`

View file

@ -15,7 +15,7 @@ each. In short summary, to call RPC server methods, a client must:
The only exception to these steps is if the client is being written in Go. In The only exception to these steps is if the client is being written in Go. In
that case, the first step may be omitted by importing the bindings from that case, the first step may be omitted by importing the bindings from
btcwallet itself. lbcwallet itself.
The rest of this document provides short examples of how to quickly get started The rest of this document provides short examples of how to quickly get started
by implementing a basic client that fetches the balance of the default account by implementing a basic client that fetches the balance of the default account
@ -52,15 +52,15 @@ import (
"fmt" "fmt"
"path/filepath" "path/filepath"
pb "github.com/btcsuite/btcwallet/rpc/walletrpc" pb "github.com/lbryio/lbcwallet/rpc/walletrpc"
"golang.org/x/net/context" "golang.org/x/net/context"
"google.golang.org/grpc" "google.golang.org/grpc"
"google.golang.org/grpc/credentials" "google.golang.org/grpc/credentials"
"github.com/btcsuite/btcutil" btcutil "github.com/lbryio/lbcutil"
) )
var certificateFile = filepath.Join(btcutil.AppDataDir("btcwallet", false), "rpc.cert") var certificateFile = filepath.Join(btcutil.AppDataDir("lbcwallet", false), "rpc.cert")
func main() { func main() {
creds, err := credentials.NewClientTLSFromFile(certificateFile, "localhost") creds, err := credentials.NewClientTLSFromFile(certificateFile, "localhost")
@ -103,9 +103,9 @@ example source code) with a source gRPC install in `/usr/local`.
First, generate the C++ language bindings by compiling the `.proto`: First, generate the C++ language bindings by compiling the `.proto`:
```bash ```bash
$ protoc -I/path/to/btcwallet/rpc --cpp_out=. --grpc_out=. \ $ protoc -I/path/to/lbcwallet/rpc --cpp_out=. --grpc_out=. \
--plugin=protoc-gen-grpc=$(which grpc_cpp_plugin) \ --plugin=protoc-gen-grpc=$(which grpc_cpp_plugin) \
/path/to/btcwallet/rpc/api.proto /path/to/lbcwallet/rpc/api.proto
``` ```
Once the `.proto` file has been compiled, the example client can be completed. Once the `.proto` file has been compiled, the example client can be completed.
@ -145,7 +145,7 @@ auto read_file(std::string const& file_path) -> std::string {
auto main() -> int { auto main() -> int {
// Before the gRPC native library (gRPC Core) is lazily loaded and // Before the gRPC native library (gRPC Core) is lazily loaded and
// initialized, an environment variable must be set so BoringSSL is // initialized, an environment variable must be set so BoringSSL is
// configured to use ECDSA TLS certificates (required by btcwallet). // configured to use ECDSA TLS certificates (required by lbcwallet).
setenv("GRPC_SSL_CIPHER_SUITES", "HIGH+ECDSA", 1); setenv("GRPC_SSL_CIPHER_SUITES", "HIGH+ECDSA", 1);
// Note: This path is operating system-dependent. This can be created // Note: This path is operating system-dependent. This can be created
@ -156,7 +156,7 @@ auto main() -> int {
if (pw == nullptr || pw->pw_dir == nullptr) { if (pw == nullptr || pw->pw_dir == nullptr) {
throw NoHomeDirectoryException{}; throw NoHomeDirectoryException{};
} }
return pw->pw_dir + "/.btcwallet/rpc.cert"s; return pw->pw_dir + "/.lbcwallet/rpc.cert"s;
}(); }();
grpc::SslCredentialsOptions cred_options{ grpc::SslCredentialsOptions cred_options{
@ -216,9 +216,9 @@ generated. The following command generates the files `Api.cs` and `ApiGrpc.cs`
in the `Example` project directory using the `Walletrpc` namespace: in the `Example` project directory using the `Walletrpc` namespace:
```PowerShell ```PowerShell
PS> & protoc.exe -I \Path\To\btcwallet\rpc --csharp_out=Example --grpc_out=Example ` PS> & protoc.exe -I \Path\To\lbcwallet\rpc --csharp_out=Example --grpc_out=Example `
--plugin=protoc-gen-grpc=\Path\To\grpc_csharp_plugin.exe ` --plugin=protoc-gen-grpc=\Path\To\grpc_csharp_plugin.exe `
\Path\To\btcwallet\rpc\api.proto \Path\To\lbcwallet\rpc\api.proto
``` ```
Once references have been added to the project for the `Google.Protobuf` and Once references have been added to the project for the `Google.Protobuf` and
@ -245,10 +245,10 @@ namespace Example
{ {
// Before the gRPC native library (gRPC Core) is lazily loaded and initialized, // Before the gRPC native library (gRPC Core) is lazily loaded and initialized,
// an environment variable must be set so BoringSSL is configured to use ECDSA TLS // an environment variable must be set so BoringSSL is configured to use ECDSA TLS
// certificates (required by btcwallet). // certificates (required by lbcwallet).
Environment.SetEnvironmentVariable("GRPC_SSL_CIPHER_SUITES", "HIGH+ECDSA"); Environment.SetEnvironmentVariable("GRPC_SSL_CIPHER_SUITES", "HIGH+ECDSA");
var walletAppData = Portability.LocalAppData(Environment.OSVersion.Platform, "Btcwallet"); var walletAppData = Portability.LocalAppData(Environment.OSVersion.Platform, "lbcwallet");
var walletTlsCertFile = Path.Combine(walletAppData, "rpc.cert"); var walletTlsCertFile = Path.Combine(walletAppData, "rpc.cert");
var cert = await FileUtils.ReadFileAsync(walletTlsCertFile); var cert = await FileUtils.ReadFileAsync(walletTlsCertFile);
var channel = new Channel("localhost:18332", new SslCredentials(cert)); var channel = new Channel("localhost:18332", new SslCredentials(cert));
@ -342,12 +342,12 @@ the wallet's API from the `.proto`. Instead, a call to `grpc.load`
with the `.proto` file path dynamically loads the Protobuf descriptor with the `.proto` file path dynamically loads the Protobuf descriptor
and generates bindings for each service. Either copy the `.proto` to and generates bindings for each service. Either copy the `.proto` to
the client project directory, or reference the file from the the client project directory, or reference the file from the
`btcwallet` project directory. `lbcwallet` project directory.
```JavaScript ```JavaScript
// Before the gRPC native library (gRPC Core) is lazily loaded and // Before the gRPC native library (gRPC Core) is lazily loaded and
// initialized, an environment variable must be set so BoringSSL is // initialized, an environment variable must be set so BoringSSL is
// configured to use ECDSA TLS certificates (required by btcwallet). // configured to use ECDSA TLS certificates (required by lbcwallet).
process.env['GRPC_SSL_CIPHER_SUITES'] = 'HIGH+ECDSA'; process.env['GRPC_SSL_CIPHER_SUITES'] = 'HIGH+ECDSA';
var fs = require('fs'); var fs = require('fs');
@ -357,12 +357,12 @@ var grpc = require('grpc');
var protoDescriptor = grpc.load('./api.proto'); var protoDescriptor = grpc.load('./api.proto');
var walletrpc = protoDescriptor.walletrpc; var walletrpc = protoDescriptor.walletrpc;
var certPath = path.join(process.env.HOME, '.btcwallet', 'rpc.cert'); var certPath = path.join(process.env.HOME, '.lbcwallet', 'rpc.cert');
if (os.platform == 'win32') { if (os.platform == 'win32') {
certPath = path.join(process.env.LOCALAPPDATA, 'Btcwallet', 'rpc.cert'); certPath = path.join(process.env.LOCALAPPDATA, 'lbcwallet', 'rpc.cert');
} else if (os.platform == 'darwin') { } else if (os.platform == 'darwin') {
certPath = path.join(process.env.HOME, 'Library', 'Application Support', certPath = path.join(process.env.HOME, 'Library', 'Application Support',
'Btcwallet', 'rpc.cert'); 'lbcwallet', 'rpc.cert');
} }
var cert = fs.readFileSync(certPath); var cert = fs.readFileSync(certPath);
@ -394,9 +394,9 @@ Full instructions for this procedure can be found
Generate Python stubs from the `.proto`: Generate Python stubs from the `.proto`:
```bash ```bash
$ protoc -I /path/to/btcsuite/btcwallet/rpc --python_out=. --grpc_out=. \ $ protoc -I /path/to/lbryio/lbcwallet/rpc --python_out=. --grpc_out=. \
--plugin=protoc-gen-grpc=$(which grpc_python_plugin) \ --plugin=protoc-gen-grpc=$(which grpc_python_plugin) \
/path/to/btcwallet/rpc/api.proto /path/to/lbcwallet/rpc/api.proto
``` ```
Implement the client: Implement the client:
@ -413,15 +413,15 @@ timeout = 1 # seconds
def main(): def main():
# Before the gRPC native library (gRPC Core) is lazily loaded and # Before the gRPC native library (gRPC Core) is lazily loaded and
# initialized, an environment variable must be set so BoringSSL is # initialized, an environment variable must be set so BoringSSL is
# configured to use ECDSA TLS certificates (required by btcwallet). # configured to use ECDSA TLS certificates (required by lbcwallet).
os.environ['GRPC_SSL_CIPHER_SUITES'] = 'HIGH+ECDSA' os.environ['GRPC_SSL_CIPHER_SUITES'] = 'HIGH+ECDSA'
cert_file_path = os.path.join(os.environ['HOME'], '.btcwallet', 'rpc.cert') cert_file_path = os.path.join(os.environ['HOME'], '.lbcwallet', 'rpc.cert')
if platform.system() == 'Windows': if platform.system() == 'Windows':
cert_file_path = os.path.join(os.environ['LOCALAPPDATA'], "Btcwallet", "rpc.cert") cert_file_path = os.path.join(os.environ['LOCALAPPDATA'], "lbcwallet", "rpc.cert")
elif platform.system() == 'Darwin': elif platform.system() == 'Darwin':
cert_file_path = os.path.join(os.environ['HOME'], 'Library', 'Application Support', cert_file_path = os.path.join(os.environ['HOME'], 'Library', 'Application Support',
'Btcwallet', 'rpc.cert') 'lbcwallet', 'rpc.cert')
with open(cert_file_path, 'r') as f: with open(cert_file_path, 'r') as f:
cert = f.read() cert = f.read()

View file

@ -1,6 +1,6 @@
# Making API Changes # Making API Changes
This document describes the process of how btcwallet developers must make This document describes the process of how lbcwallet developers must make
changes to the RPC API and server. Due to the use of gRPC and Protocol Buffers changes to the RPC API and server. Due to the use of gRPC and Protocol Buffers
for the RPC implementation, changes to this API require extra dependencies and for the RPC implementation, changes to this API require extra dependencies and
steps before changes to the server can be implemented. steps before changes to the server can be implemented.

View file

@ -7,7 +7,7 @@ package legacyrpc
import ( import (
"errors" "errors"
"github.com/btcsuite/btcd/btcjson" "github.com/lbryio/lbcd/btcjson"
) )
// TODO(jrick): There are several error paths which 'replace' various errors // TODO(jrick): There are several error paths which 'replace' various errors

View file

@ -15,19 +15,19 @@ import (
"sync" "sync"
"time" "time"
"github.com/btcsuite/btcd/btcec" "github.com/lbryio/lbcd/btcec"
"github.com/btcsuite/btcd/btcjson" "github.com/lbryio/lbcd/btcjson"
"github.com/btcsuite/btcd/chaincfg" "github.com/lbryio/lbcd/chaincfg"
"github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/lbryio/lbcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/rpcclient" "github.com/lbryio/lbcd/rpcclient"
"github.com/btcsuite/btcd/txscript" "github.com/lbryio/lbcd/txscript"
"github.com/btcsuite/btcd/wire" "github.com/lbryio/lbcd/wire"
"github.com/btcsuite/btcutil" btcutil "github.com/lbryio/lbcutil"
"github.com/btcsuite/btcwallet/chain" "github.com/lbryio/lbcwallet/chain"
"github.com/btcsuite/btcwallet/waddrmgr" "github.com/lbryio/lbcwallet/waddrmgr"
"github.com/btcsuite/btcwallet/wallet" "github.com/lbryio/lbcwallet/wallet"
"github.com/btcsuite/btcwallet/wallet/txrules" "github.com/lbryio/lbcwallet/wallet/txrules"
"github.com/btcsuite/btcwallet/wtxmgr" "github.com/lbryio/lbcwallet/wtxmgr"
) )
const ( const (
@ -117,7 +117,7 @@ var rpcHandlers = map[string]struct {
"importwallet": {handler: unimplemented, noHelp: true}, "importwallet": {handler: unimplemented, noHelp: true},
"listaddressgroupings": {handler: unimplemented, noHelp: true}, "listaddressgroupings": {handler: unimplemented, noHelp: true},
// Reference methods which can't be implemented by btcwallet due to // Reference methods which can't be implemented by lbcwallet due to
// design decision differences // design decision differences
"encryptwallet": {handler: unsupported, noHelp: true}, "encryptwallet": {handler: unsupported, noHelp: true},
"move": {handler: unsupported, noHelp: true}, "move": {handler: unsupported, noHelp: true},
@ -147,11 +147,11 @@ func unimplemented(interface{}, *wallet.Wallet) (interface{}, error) {
} }
// unsupported handles a standard bitcoind RPC request which is // unsupported handles a standard bitcoind RPC request which is
// unsupported by btcwallet due to design differences. // unsupported by lbcwallet due to design differences.
func unsupported(interface{}, *wallet.Wallet) (interface{}, error) { func unsupported(interface{}, *wallet.Wallet) (interface{}, error) {
return nil, &btcjson.RPCError{ return nil, &btcjson.RPCError{
Code: -1, Code: -1,
Message: "Request unsupported by btcwallet", Message: "Request unsupported by lbcwallet",
} }
} }
@ -473,10 +473,10 @@ func getBlockCount(icmd interface{}, w *wallet.Wallet) (interface{}, error) {
} }
// getInfo handles a getinfo request by returning the a structure containing // getInfo handles a getinfo request by returning the a structure containing
// information about the current state of btcwallet. // information about the current state of lbcwallet.
// exist. // exist.
func getInfo(icmd interface{}, w *wallet.Wallet, chainClient *chain.RPCClient) (interface{}, error) { func getInfo(icmd interface{}, w *wallet.Wallet, chainClient *chain.RPCClient) (interface{}, error) {
// Call down to btcd for all of the information in this command known // Call down to for all of the information in this command known
// by them. // by them.
info, err := chainClient.GetInfo() info, err := chainClient.GetInfo()
if err != nil { if err != nil {
@ -546,7 +546,7 @@ func getAccount(icmd interface{}, w *wallet.Wallet) (interface{}, error) {
// getAccountAddress handles a getaccountaddress by returning the most // getAccountAddress handles a getaccountaddress by returning the most
// recently-created chained address that has not yet been used (does not yet // recently-created chained address that has not yet been used (does not yet
// appear in the blockchain, or any tx that has arrived in the btcd mempool). // appear in the blockchain, or any tx that has arrived in the mempool).
// If the most recently-requested address has been used, a new address (the // If the most recently-requested address has been used, a new address (the
// next chained address in the keypool) is used. This can fail if the keypool // next chained address in the keypool) is used. This can fail if the keypool
// runs out (and will return btcjson.ErrRPCWalletKeypoolRanOut if that happens). // runs out (and will return btcjson.ErrRPCWalletKeypoolRanOut if that happens).
@ -947,17 +947,17 @@ func helpNoChainRPC(icmd interface{}, w *wallet.Wallet) (interface{}, error) {
func help(icmd interface{}, _ *wallet.Wallet, chainClient *chain.RPCClient) (interface{}, error) { func help(icmd interface{}, _ *wallet.Wallet, chainClient *chain.RPCClient) (interface{}, error) {
cmd := icmd.(*btcjson.HelpCmd) cmd := icmd.(*btcjson.HelpCmd)
// btcd returns different help messages depending on the kind of // returns different help messages depending on the kind of
// connection the client is using. Only methods available to HTTP POST // connection the client is using. Only methods available to HTTP POST
// clients are available to be used by wallet clients, even though // clients are available to be used by wallet clients, even though
// wallet itself is a websocket client to btcd. Therefore, create a // wallet itself is a websocket client to . Therefore, create a
// POST client as needed. // POST client as needed.
// //
// Returns nil if chainClient is currently nil or there is an error // Returns nil if chainClient is currently nil or there is an error
// creating the client. // creating the client.
// //
// This is hacky and is probably better handled by exposing help usage // This is hacky and is probably better handled by exposing help usage
// texts in a non-internal btcd package. // texts in a non-internal package.
postClient := func() *rpcclient.Client { postClient := func() *rpcclient.Client {
if chainClient == nil { if chainClient == nil {
return nil return nil
@ -1588,7 +1588,7 @@ func signRawTransaction(icmd interface{}, w *wallet.Wallet, chainClient *chain.R
return nil, InvalidParameterError{e} return nil, InvalidParameterError{e}
} }
// TODO: really we probably should look these up with btcd anyway to // TODO: really we probably should look these up with anyway to
// make sure that they match the blockchain if present. // make sure that they match the blockchain if present.
inputs := make(map[wire.OutPoint][]byte) inputs := make(map[wire.OutPoint][]byte)
scripts := make(map[string][]byte) scripts := make(map[string][]byte)
@ -1633,7 +1633,7 @@ func signRawTransaction(icmd interface{}, w *wallet.Wallet, chainClient *chain.R
} }
// Now we go and look for any inputs that we were not provided by // Now we go and look for any inputs that we were not provided by
// querying btcd with getrawtransaction. We queue up a bunch of async // querying with getrawtransaction. We queue up a bunch of async
// requests and will wait for replies after we have checked the rest of // requests and will wait for replies after we have checked the rest of
// the arguments. // the arguments.
requested := make(map[wire.OutPoint]rpcclient.FutureGetTxOutResult) requested := make(map[wire.OutPoint]rpcclient.FutureGetTxOutResult)

View file

@ -18,8 +18,8 @@ import (
"strings" "strings"
"testing" "testing"
"github.com/btcsuite/btcd/btcjson" "github.com/lbryio/lbcd/btcjson"
"github.com/btcsuite/btcwallet/internal/rpchelp" "github.com/lbryio/lbcwallet/internal/rpchelp"
) )
func serverMethods() map[string]struct{} { func serverMethods() map[string]struct{} {

View file

@ -18,10 +18,10 @@ import (
"sync/atomic" "sync/atomic"
"time" "time"
"github.com/btcsuite/btcd/btcjson"
"github.com/btcsuite/btcwallet/chain"
"github.com/btcsuite/btcwallet/wallet"
"github.com/btcsuite/websocket" "github.com/btcsuite/websocket"
"github.com/lbryio/lbcd/btcjson"
"github.com/lbryio/lbcwallet/chain"
"github.com/lbryio/lbcwallet/wallet"
) )
type websocketClient struct { type websocketClient struct {
@ -79,7 +79,7 @@ type Server struct {
// jsonAuthFail sends a message back to the client if the http auth is rejected. // jsonAuthFail sends a message back to the client if the http auth is rejected.
func jsonAuthFail(w http.ResponseWriter) { func jsonAuthFail(w http.ResponseWriter) {
w.Header().Add("WWW-Authenticate", `Basic realm="btcwallet RPC"`) w.Header().Add("WWW-Authenticate", `Basic realm="lbcwallet RPC"`)
http.Error(w, "401 Unauthorized.", http.StatusUnauthorized) http.Error(w, "401 Unauthorized.", http.StatusUnauthorized)
} }
@ -263,8 +263,8 @@ func (s *Server) SetChainServer(chainClient chain.Interface) {
} }
// handlerClosure creates a closure function for handling requests of the given // handlerClosure creates a closure function for handling requests of the given
// method. This may be a request that is handled directly by btcwallet, or // method. This may be a request that is handled directly by lbcwallet, or
// a chain server request that is handled by passing the request down to btcd. // a chain server request that is handled by passing the request down to .
// //
// NOTE: These handlers do not handle special cases, such as the authenticate // NOTE: These handlers do not handle special cases, such as the authenticate
// method. Each of these must be checked beforehand (the method is already // method. Each of these must be checked beforehand (the method is already
@ -442,7 +442,7 @@ out:
switch req.Method { switch req.Method {
case "stop": case "stop":
resp := makeResponse(req.ID, resp := makeResponse(req.ID,
"btcwallet stopping.", nil) "lbcwallet stopping.", nil)
mresp, err := json.Marshal(resp) mresp, err := json.Marshal(resp)
// Expected to never fail. // Expected to never fail.
if err != nil { if err != nil {
@ -593,7 +593,7 @@ func (s *Server) postClientRPC(w http.ResponseWriter, r *http.Request) {
return return
case "stop": case "stop":
stop = true stop = true
res = "btcwallet stopping" res = "lbcwallet stopping"
default: default:
res, jsonErr = s.handlerClosure(&req)() res, jsonErr = s.handlerClosure(&req)()
} }

View file

@ -8,11 +8,11 @@
// Full documentation of the API implemented by this package is maintained in a // Full documentation of the API implemented by this package is maintained in a
// language-agnostic document: // language-agnostic document:
// //
// https://github.com/btcsuite/btcwallet/blob/master/rpc/documentation/api.md // https://github.com/lbryio/lbcwallet/blob/master/rpc/documentation/api.md
// //
// Any API changes must be performed according to the steps listed here: // Any API changes must be performed according to the steps listed here:
// //
// https://github.com/btcsuite/btcwallet/blob/master/rpc/documentation/serverchanges.md // https://github.com/lbryio/lbcwallet/blob/master/rpc/documentation/serverchanges.md
package rpcserver package rpcserver
import ( import (
@ -26,20 +26,20 @@ import (
"google.golang.org/grpc/codes" "google.golang.org/grpc/codes"
"google.golang.org/grpc/status" "google.golang.org/grpc/status"
"github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/lbryio/lbcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/rpcclient" "github.com/lbryio/lbcd/rpcclient"
"github.com/btcsuite/btcd/txscript" "github.com/lbryio/lbcd/txscript"
"github.com/btcsuite/btcd/wire" "github.com/lbryio/lbcd/wire"
"github.com/btcsuite/btcutil" btcutil "github.com/lbryio/lbcutil"
"github.com/btcsuite/btcutil/hdkeychain" "github.com/lbryio/lbcutil/hdkeychain"
"github.com/btcsuite/btcwallet/chain" "github.com/lbryio/lbcwallet/chain"
"github.com/btcsuite/btcwallet/internal/cfgutil" "github.com/lbryio/lbcwallet/internal/cfgutil"
"github.com/btcsuite/btcwallet/internal/zero" "github.com/lbryio/lbcwallet/internal/zero"
"github.com/btcsuite/btcwallet/netparams" "github.com/lbryio/lbcwallet/netparams"
pb "github.com/btcsuite/btcwallet/rpc/walletrpc" pb "github.com/lbryio/lbcwallet/rpc/walletrpc"
"github.com/btcsuite/btcwallet/waddrmgr" "github.com/lbryio/lbcwallet/waddrmgr"
"github.com/btcsuite/btcwallet/wallet" "github.com/lbryio/lbcwallet/wallet"
"github.com/btcsuite/btcwallet/walletdb" "github.com/lbryio/lbcwallet/walletdb"
) )
// Public API version constants // Public API version constants
@ -109,7 +109,7 @@ type walletServer struct {
} }
// loaderServer provides RPC clients with the ability to load and close wallets, // loaderServer provides RPC clients with the ability to load and close wallets,
// as well as establishing a RPC connection to a btcd consensus server. // as well as establishing a RPC connection to a consensus server.
type loaderServer struct { type loaderServer struct {
loader *wallet.Loader loader *wallet.Loader
activeNet *netparams.Params activeNet *netparams.Params
@ -487,7 +487,7 @@ func (s *walletServer) SignTransaction(ctx context.Context, req *pb.SignTransact
// BUGS: // BUGS:
// - The transaction is not inspected to be relevant before publishing using // - The transaction is not inspected to be relevant before publishing using
// sendrawtransaction, so connection errors to btcd could result in the tx // sendrawtransaction, so connection errors to could result in the tx
// never being added to the wallet database. // never being added to the wallet database.
// - Once the above bug is fixed, wallet will require a way to purge invalid // - Once the above bug is fixed, wallet will require a way to purge invalid
// transactions from the database when they are rejected by the network, other // transactions from the database when they are rejected by the network, other

View file

@ -16,10 +16,10 @@ import (
"strings" "strings"
"time" "time"
"github.com/btcsuite/btcutil" btcutil "github.com/lbryio/lbcutil"
"github.com/btcsuite/btcwallet/rpc/legacyrpc" "github.com/lbryio/lbcwallet/rpc/legacyrpc"
"github.com/btcsuite/btcwallet/rpc/rpcserver" "github.com/lbryio/lbcwallet/rpc/rpcserver"
"github.com/btcsuite/btcwallet/wallet" "github.com/lbryio/lbcwallet/wallet"
"google.golang.org/grpc" "google.golang.org/grpc"
"google.golang.org/grpc/credentials" "google.golang.org/grpc/credentials"
) )
@ -70,7 +70,7 @@ func generateRPCKeyPair(writeKey bool) (tls.Certificate, error) {
} }
// Generate cert pair. // Generate cert pair.
org := "btcwallet autogenerated cert" org := "lbcwallet autogenerated cert"
validUntil := time.Now().Add(time.Hour * 24 * 365 * 10) validUntil := time.Now().Add(time.Hour * 24 * 365 * 10)
cert, key, err := btcutil.NewTLSCertPair(org, validUntil, nil) cert, key, err := btcutil.NewTLSCertPair(org, validUntil, nil)
if err != nil { if err != nil {

View file

@ -13,7 +13,7 @@
; The directory to open and save wallet, transaction, and unspent transaction ; The directory to open and save wallet, transaction, and unspent transaction
; output files. Two directories, `mainnet` and `testnet` are used in this ; output files. Two directories, `mainnet` and `testnet` are used in this
; directory for mainnet and testnet wallets, respectively. ; directory for mainnet and testnet wallets, respectively.
; appdata=~/.btcwallet ; appdata=~/.lbcwallet
; ------------------------------------------------------------------------------ ; ------------------------------------------------------------------------------
@ -27,11 +27,11 @@
; proxyuser= ; proxyuser=
; proxypass= ; proxypass=
; The server and port used for btcd websocket connections. ; The server and port used for websocket connections.
; rpcconnect=localhost:18334 ; rpcconnect=localhost:18334
; File containing root certificates to authenticate a TLS connections with btcd ; File containing root certificates to authenticate a TLS connections with
; cafile=~/.btcwallet/btcd.cert ; cafile=~/.lbcwallet/.cert
@ -40,8 +40,8 @@
; ------------------------------------------------------------------------------ ; ------------------------------------------------------------------------------
; TLS certificate and key file locations ; TLS certificate and key file locations
; rpccert=~/.btcwallet/rpc.cert ; rpccert=~/.lbcwallet/rpc.cert
; rpckey=~/.btcwallet/rpc.key ; rpckey=~/.lbcwallet/rpc.key
; Enable one time TLS keys. This option results in the process generating ; Enable one time TLS keys. This option results in the process generating
; a new certificate pair each startup, writing only the certificate file ; a new certificate pair each startup, writing only the certificate file
@ -86,16 +86,16 @@
; RPC settings (both client and server) ; RPC settings (both client and server)
; ------------------------------------------------------------------------------ ; ------------------------------------------------------------------------------
; Username and password to authenticate to btcd a RPC server and authenticate ; Username and password to authenticate to a RPC server and authenticate
; new client connections ; new client connections
; username= ; username=
; password= ; password=
; Alternative username and password for btcd. If set, these will be used ; Alternative username and password for . If set, these will be used
; instead of the username and password set above for authentication to a ; instead of the username and password set above for authentication to a
; btcd RPC server. ; RPC server.
; btcdusername= ; username=
; btcdpassword= ; password=
; ------------------------------------------------------------------------------ ; ------------------------------------------------------------------------------

View file

@ -13,7 +13,7 @@ import (
"io" "io"
"runtime/debug" "runtime/debug"
"github.com/btcsuite/btcwallet/internal/zero" "github.com/lbryio/lbcwallet/internal/zero"
"golang.org/x/crypto/nacl/secretbox" "golang.org/x/crypto/nacl/secretbox"
"golang.org/x/crypto/scrypt" "golang.org/x/crypto/scrypt"
) )

View file

@ -1,8 +1,8 @@
waddrmgr waddrmgr
======== ========
[![Build Status](https://travis-ci.org/btcsuite/btcwallet.png?branch=master)] [![Build Status](https://travis-ci.org/lbryio/lbcwallet.png?branch=master)]
(https://travis-ci.org/btcsuite/btcwallet) (https://travis-ci.org/lbryio/lbcwallet)
Package waddrmgr provides a secure hierarchical deterministic wallet address Package waddrmgr provides a secure hierarchical deterministic wallet address
manager. manager.
@ -42,21 +42,21 @@ report. Package waddrmgr is licensed under the liberal ISC license.
## Documentation ## Documentation
[![GoDoc](https://godoc.org/github.com/btcsuite/btcwallet/waddrmgr?status.png)] [![GoDoc](https://godoc.org/github.com/lbryio/lbcwallet/waddrmgr?status.png)]
(http://godoc.org/github.com/btcsuite/btcwallet/waddrmgr) (http://godoc.org/github.com/lbryio/lbcwallet/waddrmgr)
Full `go doc` style documentation for the project can be viewed online without Full `go doc` style documentation for the project can be viewed online without
installing this package by using the GoDoc site here: installing this package by using the GoDoc site here:
http://godoc.org/github.com/btcsuite/btcwallet/waddrmgr http://godoc.org/github.com/lbryio/lbcwallet/waddrmgr
You can also view the documentation locally once the package is installed with You can also view the documentation locally once the package is installed with
the `godoc` tool by running `godoc -http=":6060"` and pointing your browser to the `godoc` tool by running `godoc -http=":6060"` and pointing your browser to
http://localhost:6060/pkg/github.com/btcsuite/btcwallet/waddrmgr http://localhost:6060/pkg/github.com/lbryio/lbcwallet/waddrmgr
## Installation ## Installation
```bash ```bash
$ go get github.com/btcsuite/btcwallet/waddrmgr $ go get github.com/lbryio/lbcwallet/waddrmgr
``` ```
Package waddrmgr is licensed under the [copyfree](http://copyfree.org) ISC Package waddrmgr is licensed under the [copyfree](http://copyfree.org) ISC

View file

@ -9,12 +9,12 @@ import (
"fmt" "fmt"
"sync" "sync"
"github.com/btcsuite/btcd/btcec" "github.com/lbryio/lbcd/btcec"
"github.com/btcsuite/btcd/txscript" "github.com/lbryio/lbcd/txscript"
"github.com/btcsuite/btcutil" btcutil "github.com/lbryio/lbcutil"
"github.com/btcsuite/btcutil/hdkeychain" "github.com/lbryio/lbcutil/hdkeychain"
"github.com/btcsuite/btcwallet/internal/zero" "github.com/lbryio/lbcwallet/internal/zero"
"github.com/btcsuite/btcwallet/walletdb" "github.com/lbryio/lbcwallet/walletdb"
) )
// AddressType represents the various address types waddrmgr is currently able // AddressType represents the various address types waddrmgr is currently able

View file

@ -12,10 +12,10 @@ import (
"testing" "testing"
"time" "time"
"github.com/btcsuite/btcd/chaincfg" "github.com/lbryio/lbcd/chaincfg"
"github.com/btcsuite/btcutil/hdkeychain" "github.com/lbryio/lbcutil/hdkeychain"
"github.com/btcsuite/btcwallet/walletdb" "github.com/lbryio/lbcwallet/walletdb"
_ "github.com/btcsuite/btcwallet/walletdb/bdb" _ "github.com/lbryio/lbcwallet/walletdb/bdb"
) )
var ( var (

View file

@ -13,8 +13,8 @@ import (
"fmt" "fmt"
"time" "time"
"github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/lbryio/lbcd/chaincfg/chainhash"
"github.com/btcsuite/btcwallet/walletdb" "github.com/lbryio/lbcwallet/walletdb"
) )
const ( const (

View file

@ -5,8 +5,8 @@ import (
"fmt" "fmt"
"testing" "testing"
"github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/lbryio/lbcd/chaincfg/chainhash"
"github.com/btcsuite/btcwallet/walletdb" "github.com/lbryio/lbcwallet/walletdb"
) )
// TestStoreMaxReorgDepth ensures that we can only store up to MaxReorgDepth // TestStoreMaxReorgDepth ensures that we can only store up to MaxReorgDepth

View file

@ -8,7 +8,7 @@ import (
"fmt" "fmt"
"strconv" "strconv"
"github.com/btcsuite/btcutil/hdkeychain" "github.com/lbryio/lbcutil/hdkeychain"
) )
var ( var (

View file

@ -9,7 +9,7 @@ import (
"fmt" "fmt"
"testing" "testing"
"github.com/btcsuite/btcwallet/waddrmgr" "github.com/lbryio/lbcwallet/waddrmgr"
) )
// TestErrorCodeStringer tests the stringized output for the ErrorCode type. // TestErrorCodeStringer tests the stringized output for the ErrorCode type.

View file

@ -11,12 +11,12 @@ import (
"sync" "sync"
"time" "time"
"github.com/btcsuite/btcd/chaincfg" "github.com/lbryio/lbcd/chaincfg"
"github.com/btcsuite/btcutil" btcutil "github.com/lbryio/lbcutil"
"github.com/btcsuite/btcutil/hdkeychain" "github.com/lbryio/lbcutil/hdkeychain"
"github.com/btcsuite/btcwallet/internal/zero" "github.com/lbryio/lbcwallet/internal/zero"
"github.com/btcsuite/btcwallet/snacl" "github.com/lbryio/lbcwallet/snacl"
"github.com/btcsuite/btcwallet/walletdb" "github.com/lbryio/lbcwallet/walletdb"
"github.com/lightninglabs/neutrino/cache/lru" "github.com/lightninglabs/neutrino/cache/lru"
) )

View file

@ -15,14 +15,14 @@ import (
"testing" "testing"
"time" "time"
"github.com/btcsuite/btcd/btcec"
"github.com/btcsuite/btcd/chaincfg"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcutil"
"github.com/btcsuite/btcutil/hdkeychain"
"github.com/btcsuite/btcwallet/snacl"
"github.com/btcsuite/btcwallet/walletdb"
"github.com/davecgh/go-spew/spew" "github.com/davecgh/go-spew/spew"
"github.com/lbryio/lbcd/btcec"
"github.com/lbryio/lbcd/chaincfg"
"github.com/lbryio/lbcd/chaincfg/chainhash"
btcutil "github.com/lbryio/lbcutil"
"github.com/lbryio/lbcutil/hdkeychain"
"github.com/lbryio/lbcwallet/snacl"
"github.com/lbryio/lbcwallet/walletdb"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )

View file

@ -5,9 +5,9 @@ import (
"fmt" "fmt"
"time" "time"
"github.com/btcsuite/btcd/chaincfg" "github.com/lbryio/lbcd/chaincfg"
"github.com/btcsuite/btcwallet/walletdb" "github.com/lbryio/lbcwallet/walletdb"
"github.com/btcsuite/btcwallet/walletdb/migration" "github.com/lbryio/lbcwallet/walletdb/migration"
) )
// versions is a list of the different database versions. The last entry should // versions is a list of the different database versions. The last entry should

View file

@ -8,9 +8,9 @@ import (
"testing" "testing"
"time" "time"
"github.com/btcsuite/btcd/chaincfg" "github.com/lbryio/lbcd/chaincfg"
"github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/lbryio/lbcd/chaincfg/chainhash"
"github.com/btcsuite/btcwallet/walletdb" "github.com/lbryio/lbcwallet/walletdb"
) )
// applyMigration is a helper function that allows us to assert the state of the // applyMigration is a helper function that allows us to assert the state of the

View file

@ -6,15 +6,15 @@ import (
"fmt" "fmt"
"sync" "sync"
"github.com/btcsuite/btcd/btcec" "github.com/lbryio/lbcd/btcec"
"github.com/btcsuite/btcd/chaincfg" "github.com/lbryio/lbcd/chaincfg"
"github.com/btcsuite/btcd/txscript" "github.com/lbryio/lbcd/txscript"
"github.com/btcsuite/btcd/wire" "github.com/lbryio/lbcd/wire"
"github.com/btcsuite/btcutil" btcutil "github.com/lbryio/lbcutil"
"github.com/btcsuite/btcutil/hdkeychain" "github.com/lbryio/lbcutil/hdkeychain"
"github.com/btcsuite/btcwallet/internal/zero" "github.com/lbryio/lbcwallet/internal/zero"
"github.com/btcsuite/btcwallet/netparams" "github.com/lbryio/lbcwallet/netparams"
"github.com/btcsuite/btcwallet/walletdb" "github.com/lbryio/lbcwallet/walletdb"
"github.com/lightninglabs/neutrino/cache/lru" "github.com/lightninglabs/neutrino/cache/lru"
) )

View file

@ -7,8 +7,8 @@ package waddrmgr
import ( import (
"time" "time"
"github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/lbryio/lbcd/chaincfg/chainhash"
"github.com/btcsuite/btcwallet/walletdb" "github.com/lbryio/lbcwallet/walletdb"
) )
// BlockStamp defines a block (by height and a unique hash) and is used to mark // BlockStamp defines a block (by height and a unique hash) and is used to mark

View file

@ -1,126 +1,126 @@
github.com/conformal/btcwallet/waddrmgr/db.go serializeBIP0044AccountRow 100.00% (19/19) github.com/lbryio/lbcwallet/waddrmgr/db.go serializeBIP0044AccountRow 100.00% (19/19)
github.com/conformal/btcwallet/waddrmgr/manager.go Manager.lock 100.00% (12/12) github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.lock 100.00% (12/12)
github.com/conformal/btcwallet/waddrmgr/db.go serializeScriptAddress 100.00% (10/10) github.com/lbryio/lbcwallet/waddrmgr/db.go serializeScriptAddress 100.00% (10/10)
github.com/conformal/btcwallet/waddrmgr/db.go serializeImportedAddress 100.00% (10/10) github.com/lbryio/lbcwallet/waddrmgr/db.go serializeImportedAddress 100.00% (10/10)
github.com/conformal/btcwallet/waddrmgr/db.go serializeAddressRow 100.00% (9/9) github.com/lbryio/lbcwallet/waddrmgr/db.go serializeAddressRow 100.00% (9/9)
github.com/conformal/btcwallet/waddrmgr/manager.go Manager.Address 100.00% (8/8) github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.Address 100.00% (8/8)
github.com/conformal/btcwallet/waddrmgr/manager.go Manager.Lock 100.00% (8/8) github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.Lock 100.00% (8/8)
github.com/conformal/btcwallet/waddrmgr/address.go scriptAddress.Script 100.00% (7/7) github.com/lbryio/lbcwallet/waddrmgr/address.go scriptAddress.Script 100.00% (7/7)
github.com/conformal/btcwallet/waddrmgr/db.go serializeAccountRow 100.00% (6/6) github.com/lbryio/lbcwallet/waddrmgr/db.go serializeAccountRow 100.00% (6/6)
github.com/conformal/btcwallet/waddrmgr/sync.go BlockIterator.Prev 100.00% (6/6) github.com/lbryio/lbcwallet/waddrmgr/sync.go BlockIterator.Prev 100.00% (6/6)
github.com/conformal/btcwallet/waddrmgr/address.go zeroBigInt 100.00% (5/5) github.com/lbryio/lbcwallet/waddrmgr/address.go zeroBigInt 100.00% (5/5)
github.com/conformal/btcwallet/waddrmgr/manager.go Manager.zeroSensitivePublicData 100.00% (5/5) github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.zeroSensitivePublicData 100.00% (5/5)
github.com/conformal/btcwallet/waddrmgr/address.go managedAddress.lock 100.00% (4/4) github.com/lbryio/lbcwallet/waddrmgr/address.go managedAddress.lock 100.00% (4/4)
github.com/conformal/btcwallet/waddrmgr/address.go scriptAddress.lock 100.00% (4/4) github.com/lbryio/lbcwallet/waddrmgr/address.go scriptAddress.lock 100.00% (4/4)
github.com/conformal/btcwallet/waddrmgr/db.go serializeChainedAddress 100.00% (4/4) github.com/lbryio/lbcwallet/waddrmgr/db.go serializeChainedAddress 100.00% (4/4)
github.com/conformal/btcwallet/waddrmgr/address.go managedAddress.ExportPrivKey 100.00% (4/4) github.com/lbryio/lbcwallet/waddrmgr/address.go managedAddress.ExportPrivKey 100.00% (4/4)
github.com/conformal/btcwallet/waddrmgr/manager.go fileExists 100.00% (4/4) github.com/lbryio/lbcwallet/waddrmgr/manager.go fileExists 100.00% (4/4)
github.com/conformal/btcwallet/waddrmgr/error.go ManagerError.Error 100.00% (3/3) github.com/lbryio/lbcwallet/waddrmgr/error.go ManagerError.Error 100.00% (3/3)
github.com/conformal/btcwallet/waddrmgr/error.go ErrorCode.String 100.00% (3/3) github.com/lbryio/lbcwallet/waddrmgr/error.go ErrorCode.String 100.00% (3/3)
github.com/conformal/btcwallet/waddrmgr/address.go managedAddress.pubKeyBytes 100.00% (3/3) github.com/lbryio/lbcwallet/waddrmgr/address.go managedAddress.pubKeyBytes 100.00% (3/3)
github.com/conformal/btcwallet/waddrmgr/sync.go Manager.NewIterateRecentBlocks 100.00% (3/3) github.com/lbryio/lbcwallet/waddrmgr/sync.go Manager.NewIterateRecentBlocks 100.00% (3/3)
github.com/conformal/btcwallet/waddrmgr/sync.go BlockIterator.BlockStamp 100.00% (3/3) github.com/lbryio/lbcwallet/waddrmgr/sync.go BlockIterator.BlockStamp 100.00% (3/3)
github.com/conformal/btcwallet/waddrmgr/db.go accountKey 100.00% (3/3) github.com/lbryio/lbcwallet/waddrmgr/db.go accountKey 100.00% (3/3)
github.com/conformal/btcwallet/waddrmgr/sync.go Manager.SyncedTo 100.00% (3/3) github.com/lbryio/lbcwallet/waddrmgr/sync.go Manager.SyncedTo 100.00% (3/3)
github.com/conformal/btcwallet/waddrmgr/db.go managerTx.PutAccountInfo 100.00% (3/3) github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.PutAccountInfo 100.00% (3/3)
github.com/conformal/btcwallet/waddrmgr/manager.go Manager.IsLocked 100.00% (3/3) github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.IsLocked 100.00% (3/3)
github.com/conformal/btcwallet/waddrmgr/db.go managerTx.PutImportedAddress 100.00% (3/3) github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.PutImportedAddress 100.00% (3/3)
github.com/conformal/btcwallet/waddrmgr/db.go managerTx.ExistsAddress 100.00% (3/3) github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.ExistsAddress 100.00% (3/3)
github.com/conformal/btcwallet/waddrmgr/address.go zero 100.00% (2/2) github.com/lbryio/lbcwallet/waddrmgr/address.go zero 100.00% (2/2)
github.com/conformal/btcwallet/waddrmgr/address.go scriptAddress.Account 100.00% (1/1) github.com/lbryio/lbcwallet/waddrmgr/address.go scriptAddress.Account 100.00% (1/1)
github.com/conformal/btcwallet/waddrmgr/address.go scriptAddress.Compressed 100.00% (1/1) github.com/lbryio/lbcwallet/waddrmgr/address.go scriptAddress.Compressed 100.00% (1/1)
github.com/conformal/btcwallet/waddrmgr/sync.go newSyncState 100.00% (1/1) github.com/lbryio/lbcwallet/waddrmgr/sync.go newSyncState 100.00% (1/1)
github.com/conformal/btcwallet/waddrmgr/address.go scriptAddress.Internal 100.00% (1/1) github.com/lbryio/lbcwallet/waddrmgr/address.go scriptAddress.Internal 100.00% (1/1)
github.com/conformal/btcwallet/waddrmgr/manager.go cryptoKey.CopyBytes 100.00% (1/1) github.com/lbryio/lbcwallet/waddrmgr/manager.go cryptoKey.CopyBytes 100.00% (1/1)
github.com/conformal/btcwallet/waddrmgr/manager.go newManager 100.00% (1/1) github.com/lbryio/lbcwallet/waddrmgr/manager.go newManager 100.00% (1/1)
github.com/conformal/btcwallet/waddrmgr/address.go managedAddress.AddrHash 100.00% (1/1) github.com/lbryio/lbcwallet/waddrmgr/address.go managedAddress.AddrHash 100.00% (1/1)
github.com/conformal/btcwallet/waddrmgr/manager.go defaultNewSecretKey 100.00% (1/1) github.com/lbryio/lbcwallet/waddrmgr/manager.go defaultNewSecretKey 100.00% (1/1)
github.com/conformal/btcwallet/waddrmgr/address.go scriptAddress.Imported 100.00% (1/1) github.com/lbryio/lbcwallet/waddrmgr/address.go scriptAddress.Imported 100.00% (1/1)
github.com/conformal/btcwallet/waddrmgr/address.go scriptAddress.AddrHash 100.00% (1/1) github.com/lbryio/lbcwallet/waddrmgr/address.go scriptAddress.AddrHash 100.00% (1/1)
github.com/conformal/btcwallet/waddrmgr/address.go scriptAddress.Address 100.00% (1/1) github.com/lbryio/lbcwallet/waddrmgr/address.go scriptAddress.Address 100.00% (1/1)
github.com/conformal/btcwallet/waddrmgr/address.go managedAddress.Account 100.00% (1/1) github.com/lbryio/lbcwallet/waddrmgr/address.go managedAddress.Account 100.00% (1/1)
github.com/conformal/btcwallet/waddrmgr/address.go managedAddress.Internal 100.00% (1/1) github.com/lbryio/lbcwallet/waddrmgr/address.go managedAddress.Internal 100.00% (1/1)
github.com/conformal/btcwallet/waddrmgr/manager.go Manager.Net 100.00% (1/1) github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.Net 100.00% (1/1)
github.com/conformal/btcwallet/waddrmgr/address.go managedAddress.ExportPubKey 100.00% (1/1) github.com/lbryio/lbcwallet/waddrmgr/address.go managedAddress.ExportPubKey 100.00% (1/1)
github.com/conformal/btcwallet/waddrmgr/error.go managerError 100.00% (1/1) github.com/lbryio/lbcwallet/waddrmgr/error.go managerError 100.00% (1/1)
github.com/conformal/btcwallet/waddrmgr/address.go managedAddress.PubKey 100.00% (1/1) github.com/lbryio/lbcwallet/waddrmgr/address.go managedAddress.PubKey 100.00% (1/1)
github.com/conformal/btcwallet/waddrmgr/manager.go cryptoKey.Bytes 100.00% (1/1) github.com/lbryio/lbcwallet/waddrmgr/manager.go cryptoKey.Bytes 100.00% (1/1)
github.com/conformal/btcwallet/waddrmgr/address.go managedAddress.Compressed 100.00% (1/1) github.com/lbryio/lbcwallet/waddrmgr/address.go managedAddress.Compressed 100.00% (1/1)
github.com/conformal/btcwallet/waddrmgr/address.go managedAddress.Address 100.00% (1/1) github.com/lbryio/lbcwallet/waddrmgr/address.go managedAddress.Address 100.00% (1/1)
github.com/conformal/btcwallet/waddrmgr/address.go managedAddress.Imported 100.00% (1/1) github.com/lbryio/lbcwallet/waddrmgr/address.go managedAddress.Imported 100.00% (1/1)
github.com/conformal/btcwallet/waddrmgr/sync.go Manager.SetSyncedTo 93.94% (31/33) github.com/lbryio/lbcwallet/waddrmgr/sync.go Manager.SetSyncedTo 93.94% (31/33)
github.com/conformal/btcwallet/waddrmgr/address.go managedAddress.PrivKey 91.67% (11/12) github.com/lbryio/lbcwallet/waddrmgr/address.go managedAddress.PrivKey 91.67% (11/12)
github.com/conformal/btcwallet/waddrmgr/db.go deserializeBIP0044AccountRow 90.48% (19/21) github.com/lbryio/lbcwallet/waddrmgr/db.go deserializeBIP0044AccountRow 90.48% (19/21)
github.com/conformal/btcwallet/waddrmgr/manager.go Manager.keyToManaged 90.00% (9/10) github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.keyToManaged 90.00% (9/10)
github.com/conformal/btcwallet/waddrmgr/db.go managerTx.FetchCryptoKeys 88.89% (16/18) github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.FetchCryptoKeys 88.89% (16/18)
github.com/conformal/btcwallet/waddrmgr/manager.go Manager.Close 88.89% (8/9) github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.Close 88.89% (8/9)
github.com/conformal/btcwallet/waddrmgr/address.go newManagedAddressWithoutPrivKey 87.50% (7/8) github.com/lbryio/lbcwallet/waddrmgr/address.go newManagedAddressWithoutPrivKey 87.50% (7/8)
github.com/conformal/btcwallet/waddrmgr/db.go managerTx.PutRecentBlocks 85.71% (12/14) github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.PutRecentBlocks 85.71% (12/14)
github.com/conformal/btcwallet/waddrmgr/manager.go Open 85.71% (6/7) github.com/lbryio/lbcwallet/waddrmgr/manager.go Open 85.71% (6/7)
github.com/conformal/btcwallet/waddrmgr/db.go deserializeScriptAddress 84.62% (11/13) github.com/lbryio/lbcwallet/waddrmgr/db.go deserializeScriptAddress 84.62% (11/13)
github.com/conformal/btcwallet/waddrmgr/db.go deserializeImportedAddress 84.62% (11/13) github.com/lbryio/lbcwallet/waddrmgr/db.go deserializeImportedAddress 84.62% (11/13)
github.com/conformal/btcwallet/waddrmgr/db.go managerTx.FetchRecentBlocks 84.62% (11/13) github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.FetchRecentBlocks 84.62% (11/13)
github.com/conformal/btcwallet/waddrmgr/db.go managerTx.FetchMasterKeyParams 84.62% (11/13) github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.FetchMasterKeyParams 84.62% (11/13)
github.com/conformal/btcwallet/waddrmgr/db.go deserializeAddressRow 83.33% (10/12) github.com/lbryio/lbcwallet/waddrmgr/db.go deserializeAddressRow 83.33% (10/12)
github.com/conformal/btcwallet/waddrmgr/manager.go Manager.loadAndCacheAddress 83.33% (10/12) github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.loadAndCacheAddress 83.33% (10/12)
github.com/conformal/btcwallet/waddrmgr/address.go managedAddress.unlock 81.82% (9/11) github.com/lbryio/lbcwallet/waddrmgr/address.go managedAddress.unlock 81.82% (9/11)
github.com/conformal/btcwallet/waddrmgr/address.go scriptAddress.unlock 81.82% (9/11) github.com/lbryio/lbcwallet/waddrmgr/address.go scriptAddress.unlock 81.82% (9/11)
github.com/conformal/btcwallet/waddrmgr/manager.go Manager.nextAddresses 80.00% (52/65) github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.nextAddresses 80.00% (52/65)
github.com/conformal/btcwallet/waddrmgr/db.go managerTx.PutScriptAddress 80.00% (4/5) github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.PutScriptAddress 80.00% (4/5)
github.com/conformal/btcwallet/waddrmgr/manager.go Manager.ChangePassphrase 79.10% (53/67) github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.ChangePassphrase 79.10% (53/67)
github.com/conformal/btcwallet/waddrmgr/db.go managerTx.PutChainedAddress 78.26% (18/23) github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.PutChainedAddress 78.26% (18/23)
github.com/conformal/btcwallet/waddrmgr/db.go managerTx.FetchSyncedTo 77.78% (7/9) github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.FetchSyncedTo 77.78% (7/9)
github.com/conformal/btcwallet/waddrmgr/db.go managerTx.PutStartBlock 77.78% (7/9) github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.PutStartBlock 77.78% (7/9)
github.com/conformal/btcwallet/waddrmgr/db.go managerTx.FetchStartBlock 77.78% (7/9) github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.FetchStartBlock 77.78% (7/9)
github.com/conformal/btcwallet/waddrmgr/db.go managerTx.PutSyncedTo 77.78% (7/9) github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.PutSyncedTo 77.78% (7/9)
github.com/conformal/btcwallet/waddrmgr/manager.go Manager.existsAddress 77.78% (7/9) github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.existsAddress 77.78% (7/9)
github.com/conformal/btcwallet/waddrmgr/db.go deserializeAccountRow 77.78% (7/9) github.com/lbryio/lbcwallet/waddrmgr/db.go deserializeAccountRow 77.78% (7/9)
github.com/conformal/btcwallet/waddrmgr/manager.go Manager.ExportWatchingOnly 75.00% (12/16) github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.ExportWatchingOnly 75.00% (12/16)
github.com/conformal/btcwallet/waddrmgr/address.go newManagedAddressFromExtKey 75.00% (12/16) github.com/lbryio/lbcwallet/waddrmgr/address.go newManagedAddressFromExtKey 75.00% (12/16)
github.com/conformal/btcwallet/waddrmgr/address.go newManagedAddress 75.00% (9/12) github.com/lbryio/lbcwallet/waddrmgr/address.go newManagedAddress 75.00% (9/12)
github.com/conformal/btcwallet/waddrmgr/db.go managerTx.PutWatchingOnly 75.00% (6/8) github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.PutWatchingOnly 75.00% (6/8)
github.com/conformal/btcwallet/waddrmgr/db.go managerTx.PutNumAccounts 75.00% (6/8) github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.PutNumAccounts 75.00% (6/8)
github.com/conformal/btcwallet/waddrmgr/address.go newScriptAddress 75.00% (3/4) github.com/lbryio/lbcwallet/waddrmgr/address.go newScriptAddress 75.00% (3/4)
github.com/conformal/btcwallet/waddrmgr/manager.go defaultNewCryptoKey 75.00% (3/4) github.com/lbryio/lbcwallet/waddrmgr/manager.go defaultNewCryptoKey 75.00% (3/4)
github.com/conformal/btcwallet/waddrmgr/manager.go Manager.chainAddressRowToManaged 75.00% (3/4) github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.chainAddressRowToManaged 75.00% (3/4)
github.com/conformal/btcwallet/waddrmgr/manager.go checkBranchKeys 75.00% (3/4) github.com/lbryio/lbcwallet/waddrmgr/manager.go checkBranchKeys 75.00% (3/4)
github.com/conformal/btcwallet/waddrmgr/manager.go Manager.deriveKeyFromPath 75.00% (3/4) github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.deriveKeyFromPath 75.00% (3/4)
github.com/conformal/btcwallet/waddrmgr/manager.go loadManager 72.55% (37/51) github.com/lbryio/lbcwallet/waddrmgr/manager.go loadManager 72.55% (37/51)
github.com/conformal/btcwallet/waddrmgr/db.go managerTx.putAddress 71.43% (5/7) github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.putAddress 71.43% (5/7)
github.com/conformal/btcwallet/waddrmgr/db.go deserializeChainedAddress 71.43% (5/7) github.com/lbryio/lbcwallet/waddrmgr/db.go deserializeChainedAddress 71.43% (5/7)
github.com/conformal/btcwallet/waddrmgr/manager.go Manager.deriveKey 69.23% (9/13) github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.deriveKey 69.23% (9/13)
github.com/conformal/btcwallet/waddrmgr/manager.go Manager.ImportScript 67.44% (29/43) github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.ImportScript 67.44% (29/43)
github.com/conformal/btcwallet/waddrmgr/manager.go Manager.Unlock 67.35% (33/49) github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.Unlock 67.35% (33/49)
github.com/conformal/btcwallet/waddrmgr/db.go managerTx.FetchAddress 66.67% (10/15) github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.FetchAddress 66.67% (10/15)
github.com/conformal/btcwallet/waddrmgr/manager.go Manager.importedAddressRowToManaged 66.67% (10/15) github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.importedAddressRowToManaged 66.67% (10/15)
github.com/conformal/btcwallet/waddrmgr/db.go managerTx.PutMasterKeyParams 66.67% (8/12) github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.PutMasterKeyParams 66.67% (8/12)
github.com/conformal/btcwallet/waddrmgr/manager.go Manager.LastInternalAddress 66.67% (6/9) github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.LastInternalAddress 66.67% (6/9)
github.com/conformal/btcwallet/waddrmgr/manager.go Manager.LastExternalAddress 66.67% (6/9) github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.LastExternalAddress 66.67% (6/9)
github.com/conformal/btcwallet/waddrmgr/db.go managerTx.putAccountRow 66.67% (4/6) github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.putAccountRow 66.67% (4/6)
github.com/conformal/btcwallet/waddrmgr/manager.go Manager.rowInterfaceToManaged 66.67% (4/6) github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.rowInterfaceToManaged 66.67% (4/6)
github.com/conformal/btcwallet/waddrmgr/manager.go Manager.NextExternalAddresses 66.67% (4/6) github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.NextExternalAddresses 66.67% (4/6)
github.com/conformal/btcwallet/waddrmgr/manager.go Manager.NextInternalAddresses 66.67% (4/6) github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.NextInternalAddresses 66.67% (4/6)
github.com/conformal/btcwallet/waddrmgr/db.go managerTx.FetchWatchingOnly 66.67% (4/6) github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.FetchWatchingOnly 66.67% (4/6)
github.com/conformal/btcwallet/waddrmgr/sync.go syncState.iter 66.67% (2/3) github.com/lbryio/lbcwallet/waddrmgr/sync.go syncState.iter 66.67% (2/3)
github.com/conformal/btcwallet/waddrmgr/db.go managerTx.DeletePrivateKeys 66.04% (35/53) github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.DeletePrivateKeys 66.04% (35/53)
github.com/conformal/btcwallet/waddrmgr/db.go openOrCreateDB 66.04% (35/53) github.com/lbryio/lbcwallet/waddrmgr/db.go openOrCreateDB 66.04% (35/53)
github.com/conformal/btcwallet/waddrmgr/manager.go Manager.ImportPrivateKey 64.71% (33/51) github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.ImportPrivateKey 64.71% (33/51)
github.com/conformal/btcwallet/waddrmgr/db.go managerTx.PutCryptoKeys 64.71% (11/17) github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.PutCryptoKeys 64.71% (11/17)
github.com/conformal/btcwallet/waddrmgr/manager.go Manager.loadAccountInfo 62.96% (34/54) github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.loadAccountInfo 62.96% (34/54)
github.com/conformal/btcwallet/waddrmgr/db.go managerTx.FetchAccountInfo 61.54% (8/13) github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.FetchAccountInfo 61.54% (8/13)
github.com/conformal/btcwallet/waddrmgr/manager.go Manager.scriptAddressRowToManaged 60.00% (3/5) github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.scriptAddressRowToManaged 60.00% (3/5)
github.com/conformal/btcwallet/waddrmgr/manager.go Create 58.59% (58/99) github.com/lbryio/lbcwallet/waddrmgr/manager.go Create 58.59% (58/99)
github.com/conformal/btcwallet/waddrmgr/manager.go deriveAccountKey 53.85% (7/13) github.com/lbryio/lbcwallet/waddrmgr/manager.go deriveAccountKey 53.85% (7/13)
github.com/conformal/btcwallet/waddrmgr/db.go managerDB.Update 50.00% (4/8) github.com/lbryio/lbcwallet/waddrmgr/db.go managerDB.Update 50.00% (4/8)
github.com/conformal/btcwallet/waddrmgr/db.go managerDB.View 50.00% (4/8) github.com/lbryio/lbcwallet/waddrmgr/db.go managerDB.View 50.00% (4/8)
github.com/conformal/btcwallet/waddrmgr/db.go managerDB.Close 50.00% (2/4) github.com/lbryio/lbcwallet/waddrmgr/db.go managerDB.Close 50.00% (2/4)
github.com/conformal/btcwallet/waddrmgr/db.go managerDB.CopyDB 45.45% (5/11) github.com/lbryio/lbcwallet/waddrmgr/db.go managerDB.CopyDB 45.45% (5/11)
github.com/conformal/btcwallet/waddrmgr/db.go managerTx.FetchAllAddresses 0.00% (0/20) github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.FetchAllAddresses 0.00% (0/20)
github.com/conformal/btcwallet/waddrmgr/manager.go Manager.AllActiveAddresses 0.00% (0/16) github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.AllActiveAddresses 0.00% (0/16)
github.com/conformal/btcwallet/waddrmgr/db.go managerDB.WriteTo 0.00% (0/11) github.com/lbryio/lbcwallet/waddrmgr/db.go managerDB.WriteTo 0.00% (0/11)
github.com/conformal/btcwallet/waddrmgr/sync.go BlockIterator.Next 0.00% (0/6) github.com/lbryio/lbcwallet/waddrmgr/sync.go BlockIterator.Next 0.00% (0/6)
github.com/conformal/btcwallet/waddrmgr/db.go managerTx.FetchNumAccounts 0.00% (0/6) github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.FetchNumAccounts 0.00% (0/6)
github.com/conformal/btcwallet/waddrmgr/manager.go Manager.Export 0.00% (0/3) github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.Export 0.00% (0/3)
github.com/conformal/btcwallet/waddrmgr ----------------------------------- 72.59% (1030/1419) github.com/lbryio/lbcwallet/waddrmgr ----------------------------------- 72.59% (1030/1419)

View file

@ -1,8 +1,8 @@
wallet wallet
====== ======
[![Build Status](https://travis-ci.org/btcsuite/btcwallet.png?branch=master)] [![Build Status](https://travis-ci.org/lbryio/lbcwallet.png?branch=master)]
(https://travis-ci.org/btcsuite/btcwallet) (https://travis-ci.org/lbryio/lbcwallet)
## Feature Overview ## Feature Overview
@ -10,21 +10,21 @@ TODO: Flesh out this section
## Documentation ## Documentation
[![GoDoc](https://godoc.org/github.com/btcsuite/btcwallet/wallet?status.png)] [![GoDoc](https://godoc.org/github.com/lbryio/lbcwallet/wallet?status.png)]
(http://godoc.org/github.com/btcsuite/btcwallet/wallet) (http://godoc.org/github.com/lbryio/lbcwallet/wallet)
Full `go doc` style documentation for the project can be viewed online without Full `go doc` style documentation for the project can be viewed online without
installing this package by using the GoDoc site here: installing this package by using the GoDoc site here:
http://godoc.org/github.com/btcsuite/btcwallet/wallet http://godoc.org/github.com/lbryio/lbcwallet/wallet
You can also view the documentation locally once the package is installed with You can also view the documentation locally once the package is installed with
the `godoc` tool by running `godoc -http=":6060"` and pointing your browser to the `godoc` tool by running `godoc -http=":6060"` and pointing your browser to
http://localhost:6060/pkg/github.com/btcsuite/btcwallet/wallet http://localhost:6060/pkg/github.com/lbryio/lbcwallet/wallet
## Installation ## Installation
```bash ```bash
$ go get github.com/btcsuite/btcwallet/wallet $ go get github.com/lbryio/lbcwallet/wallet
``` ```
Package wallet is licensed under the [copyfree](http://copyfree.org) ISC Package wallet is licensed under the [copyfree](http://copyfree.org) ISC

View file

@ -9,13 +9,13 @@ import (
"fmt" "fmt"
"time" "time"
"github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/lbryio/lbcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/txscript" "github.com/lbryio/lbcd/txscript"
"github.com/btcsuite/btcd/wire" "github.com/lbryio/lbcd/wire"
"github.com/btcsuite/btcwallet/chain" "github.com/lbryio/lbcwallet/chain"
"github.com/btcsuite/btcwallet/waddrmgr" "github.com/lbryio/lbcwallet/waddrmgr"
"github.com/btcsuite/btcwallet/walletdb" "github.com/lbryio/lbcwallet/walletdb"
"github.com/btcsuite/btcwallet/wtxmgr" "github.com/lbryio/lbcwallet/wtxmgr"
) )
const ( const (
@ -39,7 +39,7 @@ func (w *Wallet) handleChainNotifications() {
// TODO(aakselrod): There's a race condition here, which // TODO(aakselrod): There's a race condition here, which
// happens when a reorg occurs between the // happens when a reorg occurs between the
// rescanProgress notification and the last GetBlockHash // rescanProgress notification and the last GetBlockHash
// call. The solution when using btcd is to make btcd // call. The solution when using is to make
// send blockconnected notifications with each block // send blockconnected notifications with each block
// the way Neutrino does, and get rid of the loop. The // the way Neutrino does, and get rid of the loop. The
// other alternative is to check the final hash and, // other alternative is to check the final hash and,

View file

@ -6,11 +6,11 @@ import (
"testing" "testing"
"time" "time"
"github.com/btcsuite/btcd/chaincfg" "github.com/lbryio/lbcd/chaincfg"
"github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/lbryio/lbcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire" "github.com/lbryio/lbcd/wire"
"github.com/btcsuite/btcwallet/waddrmgr" "github.com/lbryio/lbcwallet/waddrmgr"
_ "github.com/btcsuite/btcwallet/walletdb/bdb" _ "github.com/lbryio/lbcwallet/walletdb/bdb"
) )
const ( const (

View file

@ -8,9 +8,9 @@ package wallet
import ( import (
"time" "time"
"github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/lbryio/lbcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire" "github.com/lbryio/lbcd/wire"
"github.com/btcsuite/btcutil" btcutil "github.com/lbryio/lbcutil"
) )
// Note: The following common types should never reference the Wallet type. // Note: The following common types should never reference the Wallet type.

View file

@ -10,15 +10,15 @@ import (
"math/rand" "math/rand"
"sort" "sort"
"github.com/btcsuite/btcd/btcec" "github.com/lbryio/lbcd/btcec"
"github.com/btcsuite/btcd/txscript" "github.com/lbryio/lbcd/txscript"
"github.com/btcsuite/btcd/wire" "github.com/lbryio/lbcd/wire"
"github.com/btcsuite/btcutil" btcutil "github.com/lbryio/lbcutil"
"github.com/btcsuite/btcwallet/waddrmgr" "github.com/lbryio/lbcwallet/waddrmgr"
"github.com/btcsuite/btcwallet/wallet/txauthor" "github.com/lbryio/lbcwallet/wallet/txauthor"
"github.com/btcsuite/btcwallet/wallet/txsizes" "github.com/lbryio/lbcwallet/wallet/txsizes"
"github.com/btcsuite/btcwallet/walletdb" "github.com/lbryio/lbcwallet/walletdb"
"github.com/btcsuite/btcwallet/wtxmgr" "github.com/lbryio/lbcwallet/wtxmgr"
) )
// byAmount defines the methods needed to satisify sort.Interface to // byAmount defines the methods needed to satisify sort.Interface to

View file

@ -9,16 +9,16 @@ import (
"testing" "testing"
"time" "time"
"github.com/btcsuite/btcd/chaincfg" "github.com/lbryio/lbcd/chaincfg"
"github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/lbryio/lbcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/txscript" "github.com/lbryio/lbcd/txscript"
"github.com/btcsuite/btcd/wire" "github.com/lbryio/lbcd/wire"
"github.com/btcsuite/btcutil" btcutil "github.com/lbryio/lbcutil"
"github.com/btcsuite/btcwallet/waddrmgr" "github.com/lbryio/lbcwallet/waddrmgr"
"github.com/btcsuite/btcwallet/wallet/txauthor" "github.com/lbryio/lbcwallet/wallet/txauthor"
"github.com/btcsuite/btcwallet/walletdb" "github.com/lbryio/lbcwallet/walletdb"
_ "github.com/btcsuite/btcwallet/walletdb/bdb" _ "github.com/lbryio/lbcwallet/walletdb/bdb"
"github.com/btcsuite/btcwallet/wtxmgr" "github.com/lbryio/lbcwallet/wtxmgr"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )

View file

@ -6,10 +6,10 @@ import (
"testing" "testing"
"time" "time"
"github.com/btcsuite/btcd/chaincfg" "github.com/lbryio/lbcd/chaincfg"
"github.com/btcsuite/btcutil/hdkeychain" "github.com/lbryio/lbcutil/hdkeychain"
"github.com/btcsuite/btcwallet/waddrmgr" "github.com/lbryio/lbcwallet/waddrmgr"
"github.com/btcsuite/btcwallet/walletdb" "github.com/lbryio/lbcwallet/walletdb"
) )
// defaultDBTimeout specifies the timeout value when opening the wallet // defaultDBTimeout specifies the timeout value when opening the wallet

View file

@ -7,10 +7,10 @@ package wallet
import ( import (
"fmt" "fmt"
"github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/lbryio/lbcd/chaincfg/chainhash"
"github.com/btcsuite/btcwallet/waddrmgr" "github.com/lbryio/lbcwallet/waddrmgr"
"github.com/btcsuite/btcwallet/walletdb" "github.com/lbryio/lbcwallet/walletdb"
"github.com/btcsuite/btcwallet/wtxmgr" "github.com/lbryio/lbcwallet/wtxmgr"
) )
var ( var (
@ -25,7 +25,7 @@ var (
// a full chain rescan of all wallet transaction and UTXO data. User-defined // a full chain rescan of all wallet transaction and UTXO data. User-defined
// transaction labels can optionally be kept by setting keepLabels to true. // transaction labels can optionally be kept by setting keepLabels to true.
func DropTransactionHistory(db walletdb.DB, keepLabels bool) error { func DropTransactionHistory(db walletdb.DB, keepLabels bool) error {
log.Infof("Dropping btcwallet transaction history") log.Infof("Dropping lbcwallet transaction history")
err := walletdb.Update(db, func(tx walletdb.ReadWriteTx) error { err := walletdb.Update(db, func(tx walletdb.ReadWriteTx) error {
// If we want to keep our tx labels, we read them out so we // If we want to keep our tx labels, we read them out so we

View file

@ -5,13 +5,13 @@ import (
"errors" "errors"
"fmt" "fmt"
"github.com/btcsuite/btcd/btcec" "github.com/lbryio/lbcd/btcec"
"github.com/btcsuite/btcd/wire" "github.com/lbryio/lbcd/wire"
"github.com/btcsuite/btcutil" btcutil "github.com/lbryio/lbcutil"
"github.com/btcsuite/btcutil/hdkeychain" "github.com/lbryio/lbcutil/hdkeychain"
"github.com/btcsuite/btcwallet/netparams" "github.com/lbryio/lbcwallet/netparams"
"github.com/btcsuite/btcwallet/waddrmgr" "github.com/lbryio/lbcwallet/waddrmgr"
"github.com/btcsuite/btcwallet/walletdb" "github.com/lbryio/lbcwallet/walletdb"
) )
const ( const (

View file

@ -5,11 +5,11 @@ import (
"strings" "strings"
"testing" "testing"
"github.com/btcsuite/btcd/chaincfg" "github.com/lbryio/lbcd/chaincfg"
"github.com/btcsuite/btcd/txscript" "github.com/lbryio/lbcd/txscript"
"github.com/btcsuite/btcutil" btcutil "github.com/lbryio/lbcutil"
"github.com/btcsuite/btcutil/hdkeychain" "github.com/lbryio/lbcutil/hdkeychain"
"github.com/btcsuite/btcwallet/waddrmgr" "github.com/lbryio/lbcwallet/waddrmgr"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )

View file

@ -12,11 +12,11 @@ import (
"sync" "sync"
"time" "time"
"github.com/btcsuite/btcd/chaincfg" "github.com/lbryio/lbcd/chaincfg"
"github.com/btcsuite/btcutil/hdkeychain" "github.com/lbryio/lbcutil/hdkeychain"
"github.com/btcsuite/btcwallet/internal/prompt" "github.com/lbryio/lbcwallet/internal/prompt"
"github.com/btcsuite/btcwallet/waddrmgr" "github.com/lbryio/lbcwallet/waddrmgr"
"github.com/btcsuite/btcwallet/walletdb" "github.com/lbryio/lbcwallet/walletdb"
) )
const ( const (

View file

@ -6,9 +6,9 @@ package wallet
import ( import (
"github.com/btcsuite/btclog" "github.com/btcsuite/btclog"
"github.com/btcsuite/btcwallet/waddrmgr" "github.com/lbryio/lbcwallet/waddrmgr"
"github.com/btcsuite/btcwallet/walletdb/migration" "github.com/lbryio/lbcwallet/walletdb/migration"
"github.com/btcsuite/btcwallet/wtxmgr" "github.com/lbryio/lbcwallet/wtxmgr"
) )
// log is a logger that is initialized with no output filters. This // log is a logger that is initialized with no output filters. This

View file

@ -3,11 +3,11 @@ package wallet
import ( import (
"time" "time"
"github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/lbryio/lbcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire" "github.com/lbryio/lbcd/wire"
"github.com/btcsuite/btcutil" btcutil "github.com/lbryio/lbcutil"
"github.com/btcsuite/btcwallet/chain" "github.com/lbryio/lbcwallet/chain"
"github.com/btcsuite/btcwallet/waddrmgr" "github.com/lbryio/lbcwallet/waddrmgr"
) )
type mockChainClient struct { type mockChainClient struct {

View file

@ -8,10 +8,10 @@ package wallet
import ( import (
"errors" "errors"
"github.com/btcsuite/btcd/txscript" "github.com/lbryio/lbcd/txscript"
"github.com/btcsuite/btcutil" btcutil "github.com/lbryio/lbcutil"
"github.com/btcsuite/btcwallet/waddrmgr" "github.com/lbryio/lbcwallet/waddrmgr"
"github.com/btcsuite/btcwallet/walletdb" "github.com/lbryio/lbcwallet/walletdb"
) )
// MakeMultiSigScript creates a multi-signature script that can be redeemed with // MakeMultiSigScript creates a multi-signature script that can be redeemed with

View file

@ -8,12 +8,12 @@ import (
"bytes" "bytes"
"sync" "sync"
"github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/lbryio/lbcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/txscript" "github.com/lbryio/lbcd/txscript"
"github.com/btcsuite/btcutil" btcutil "github.com/lbryio/lbcutil"
"github.com/btcsuite/btcwallet/waddrmgr" "github.com/lbryio/lbcwallet/waddrmgr"
"github.com/btcsuite/btcwallet/walletdb" "github.com/lbryio/lbcwallet/walletdb"
"github.com/btcsuite/btcwallet/wtxmgr" "github.com/lbryio/lbcwallet/wtxmgr"
) )
// TODO: It would be good to send errors during notification creation to the rpc // TODO: It would be good to send errors during notification creation to the rpc

View file

@ -8,15 +8,15 @@ import (
"bytes" "bytes"
"fmt" "fmt"
"github.com/btcsuite/btcd/txscript" "github.com/lbryio/lbcd/txscript"
"github.com/btcsuite/btcd/wire" "github.com/lbryio/lbcd/wire"
"github.com/btcsuite/btcutil" btcutil "github.com/lbryio/lbcutil"
"github.com/btcsuite/btcutil/psbt" "github.com/lbryio/lbcutil/psbt"
"github.com/btcsuite/btcwallet/waddrmgr" "github.com/lbryio/lbcwallet/waddrmgr"
"github.com/btcsuite/btcwallet/wallet/txauthor" "github.com/lbryio/lbcwallet/wallet/txauthor"
"github.com/btcsuite/btcwallet/wallet/txrules" "github.com/lbryio/lbcwallet/wallet/txrules"
"github.com/btcsuite/btcwallet/walletdb" "github.com/lbryio/lbcwallet/walletdb"
"github.com/btcsuite/btcwallet/wtxmgr" "github.com/lbryio/lbcwallet/wtxmgr"
) )
// FundPsbt creates a fully populated PSBT packet that contains enough inputs to // FundPsbt creates a fully populated PSBT packet that contains enough inputs to

View file

@ -10,11 +10,11 @@ import (
"strings" "strings"
"testing" "testing"
"github.com/btcsuite/btcd/txscript" "github.com/lbryio/lbcd/txscript"
"github.com/btcsuite/btcd/wire" "github.com/lbryio/lbcd/wire"
"github.com/btcsuite/btcutil" btcutil "github.com/lbryio/lbcutil"
"github.com/btcsuite/btcutil/psbt" "github.com/lbryio/lbcutil/psbt"
"github.com/btcsuite/btcwallet/waddrmgr" "github.com/lbryio/lbcwallet/waddrmgr"
) )
var ( var (

View file

@ -3,15 +3,15 @@ package wallet
import ( import (
"time" "time"
"github.com/btcsuite/btcd/chaincfg" "github.com/lbryio/lbcd/chaincfg"
"github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/lbryio/lbcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/txscript" "github.com/lbryio/lbcd/txscript"
"github.com/btcsuite/btcd/wire" "github.com/lbryio/lbcd/wire"
"github.com/btcsuite/btcutil" btcutil "github.com/lbryio/lbcutil"
"github.com/btcsuite/btcutil/hdkeychain" "github.com/lbryio/lbcutil/hdkeychain"
"github.com/btcsuite/btcwallet/waddrmgr" "github.com/lbryio/lbcwallet/waddrmgr"
"github.com/btcsuite/btcwallet/walletdb" "github.com/lbryio/lbcwallet/walletdb"
"github.com/btcsuite/btcwallet/wtxmgr" "github.com/lbryio/lbcwallet/wtxmgr"
) )
// RecoveryManager maintains the state required to recover previously used // RecoveryManager maintains the state required to recover previously used

View file

@ -4,7 +4,7 @@ import (
"runtime" "runtime"
"testing" "testing"
"github.com/btcsuite/btcwallet/wallet" "github.com/lbryio/lbcwallet/wallet"
) )
// Harness holds the BranchRecoveryState being tested, the recovery window being // Harness holds the BranchRecoveryState being tested, the recovery window being

View file

@ -5,12 +5,12 @@
package wallet package wallet
import ( import (
"github.com/btcsuite/btcd/txscript" "github.com/lbryio/lbcd/txscript"
"github.com/btcsuite/btcd/wire" "github.com/lbryio/lbcd/wire"
"github.com/btcsuite/btcutil" btcutil "github.com/lbryio/lbcutil"
"github.com/btcsuite/btcwallet/chain" "github.com/lbryio/lbcwallet/chain"
"github.com/btcsuite/btcwallet/waddrmgr" "github.com/lbryio/lbcwallet/waddrmgr"
"github.com/btcsuite/btcwallet/wtxmgr" "github.com/lbryio/lbcwallet/wtxmgr"
) )
// RescanProgressMsg reports the current progress made by a rescan for a // RescanProgressMsg reports the current progress made by a rescan for a

View file

@ -7,11 +7,11 @@ package wallet
import ( import (
"fmt" "fmt"
"github.com/btcsuite/btcd/btcec" "github.com/lbryio/lbcd/btcec"
"github.com/btcsuite/btcd/txscript" "github.com/lbryio/lbcd/txscript"
"github.com/btcsuite/btcd/wire" "github.com/lbryio/lbcd/wire"
"github.com/btcsuite/btcutil" btcutil "github.com/lbryio/lbcutil"
"github.com/btcsuite/btcwallet/waddrmgr" "github.com/lbryio/lbcwallet/waddrmgr"
) )
// ScriptForOutput returns the address, witness program and redeem script for a // ScriptForOutput returns the address, witness program and redeem script for a

View file

@ -7,10 +7,10 @@ package wallet
import ( import (
"testing" "testing"
"github.com/btcsuite/btcd/txscript" "github.com/lbryio/lbcd/txscript"
"github.com/btcsuite/btcd/wire" "github.com/lbryio/lbcd/wire"
"github.com/btcsuite/btcutil" btcutil "github.com/lbryio/lbcutil"
"github.com/btcsuite/btcwallet/waddrmgr" "github.com/lbryio/lbcwallet/waddrmgr"
) )
// TestComputeInputScript checks that the wallet can create the full // TestComputeInputScript checks that the wallet can create the full

View file

@ -8,12 +8,12 @@ package txauthor
import ( import (
"errors" "errors"
"github.com/btcsuite/btcd/chaincfg" "github.com/lbryio/lbcd/chaincfg"
"github.com/btcsuite/btcd/txscript" "github.com/lbryio/lbcd/txscript"
"github.com/btcsuite/btcd/wire" "github.com/lbryio/lbcd/wire"
"github.com/btcsuite/btcutil" btcutil "github.com/lbryio/lbcutil"
"github.com/btcsuite/btcwallet/wallet/txrules" "github.com/lbryio/lbcwallet/wallet/txrules"
"github.com/btcsuite/btcwallet/wallet/txsizes" "github.com/lbryio/lbcwallet/wallet/txsizes"
) )
// SumOutputValues sums up the list of TxOuts and returns an Amount. // SumOutputValues sums up the list of TxOuts and returns an Amount.

View file

@ -7,10 +7,10 @@ package txauthor
import ( import (
"testing" "testing"
"github.com/btcsuite/btcd/wire" "github.com/lbryio/lbcd/wire"
"github.com/btcsuite/btcutil" btcutil "github.com/lbryio/lbcutil"
"github.com/btcsuite/btcwallet/wallet/txrules" "github.com/lbryio/lbcwallet/wallet/txrules"
"github.com/btcsuite/btcwallet/wallet/txsizes" "github.com/lbryio/lbcwallet/wallet/txsizes"
) )
func p2pkhOutputs(amounts ...btcutil.Amount) []*wire.TxOut { func p2pkhOutputs(amounts ...btcutil.Amount) []*wire.TxOut {

View file

@ -9,10 +9,10 @@ package txrules
import ( import (
"errors" "errors"
"github.com/btcsuite/btcd/mempool" "github.com/lbryio/lbcd/mempool"
"github.com/btcsuite/btcd/txscript" "github.com/lbryio/lbcd/txscript"
"github.com/btcsuite/btcd/wire" "github.com/lbryio/lbcd/wire"
"github.com/btcsuite/btcutil" btcutil "github.com/lbryio/lbcutil"
) )
// DefaultRelayFeePerKb is the default minimum relay fee policy for a mempool. // DefaultRelayFeePerKb is the default minimum relay fee policy for a mempool.

View file

@ -5,9 +5,9 @@
package txsizes package txsizes
import ( import (
"github.com/btcsuite/btcd/blockchain" "github.com/lbryio/lbcd/blockchain"
"github.com/btcsuite/btcd/txscript" "github.com/lbryio/lbcd/txscript"
"github.com/btcsuite/btcd/wire" "github.com/lbryio/lbcd/wire"
) )
// Worst case script and input/output size estimates. // Worst case script and input/output size estimates.

View file

@ -5,7 +5,7 @@ import (
"encoding/hex" "encoding/hex"
"testing" "testing"
"github.com/btcsuite/btcd/wire" "github.com/lbryio/lbcd/wire"
) )
const ( const (

View file

@ -6,9 +6,9 @@
package wallet package wallet
import ( import (
"github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/lbryio/lbcd/chaincfg/chainhash"
"github.com/btcsuite/btcwallet/walletdb" "github.com/lbryio/lbcwallet/walletdb"
"github.com/btcsuite/btcwallet/wtxmgr" "github.com/lbryio/lbcwallet/wtxmgr"
) )
type unstableAPI struct { type unstableAPI struct {

View file

@ -9,12 +9,12 @@ import (
"errors" "errors"
"fmt" "fmt"
"github.com/btcsuite/btcd/txscript" "github.com/lbryio/lbcd/txscript"
"github.com/btcsuite/btcd/wire" "github.com/lbryio/lbcd/wire"
"github.com/btcsuite/btcutil/hdkeychain" "github.com/lbryio/lbcutil/hdkeychain"
"github.com/btcsuite/btcutil/psbt" "github.com/lbryio/lbcutil/psbt"
"github.com/btcsuite/btcwallet/waddrmgr" "github.com/lbryio/lbcwallet/waddrmgr"
"github.com/btcsuite/btcwallet/walletdb" "github.com/lbryio/lbcwallet/walletdb"
) )
var ( var (

View file

@ -8,10 +8,10 @@ import (
"bytes" "bytes"
"testing" "testing"
"github.com/btcsuite/btcd/txscript" "github.com/lbryio/lbcd/txscript"
"github.com/btcsuite/btcd/wire" "github.com/lbryio/lbcd/wire"
"github.com/btcsuite/btcutil/hdkeychain" "github.com/lbryio/lbcutil/hdkeychain"
"github.com/btcsuite/btcwallet/waddrmgr" "github.com/lbryio/lbcwallet/waddrmgr"
) )
// TestFetchInputInfo checks that the wallet can gather information about an // TestFetchInputInfo checks that the wallet can gather information about an

View file

@ -15,23 +15,23 @@ import (
"sync" "sync"
"time" "time"
"github.com/btcsuite/btcd/blockchain"
"github.com/btcsuite/btcd/btcec"
"github.com/btcsuite/btcd/btcjson"
"github.com/btcsuite/btcd/chaincfg"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/txscript"
"github.com/btcsuite/btcd/wire"
"github.com/btcsuite/btcutil"
"github.com/btcsuite/btcutil/hdkeychain"
"github.com/btcsuite/btcwallet/chain"
"github.com/btcsuite/btcwallet/waddrmgr"
"github.com/btcsuite/btcwallet/wallet/txauthor"
"github.com/btcsuite/btcwallet/wallet/txrules"
"github.com/btcsuite/btcwallet/walletdb"
"github.com/btcsuite/btcwallet/walletdb/migration"
"github.com/btcsuite/btcwallet/wtxmgr"
"github.com/davecgh/go-spew/spew" "github.com/davecgh/go-spew/spew"
"github.com/lbryio/lbcd/blockchain"
"github.com/lbryio/lbcd/btcec"
"github.com/lbryio/lbcd/btcjson"
"github.com/lbryio/lbcd/chaincfg"
"github.com/lbryio/lbcd/chaincfg/chainhash"
"github.com/lbryio/lbcd/txscript"
"github.com/lbryio/lbcd/wire"
btcutil "github.com/lbryio/lbcutil"
"github.com/lbryio/lbcutil/hdkeychain"
"github.com/lbryio/lbcwallet/chain"
"github.com/lbryio/lbcwallet/waddrmgr"
"github.com/lbryio/lbcwallet/wallet/txauthor"
"github.com/lbryio/lbcwallet/wallet/txrules"
"github.com/lbryio/lbcwallet/walletdb"
"github.com/lbryio/lbcwallet/walletdb/migration"
"github.com/lbryio/lbcwallet/wtxmgr"
) )
const ( const (
@ -1531,7 +1531,7 @@ func (w *Wallet) CalculateAccountBalances(account uint32, confirms int32) (Balan
// CurrentAddress gets the most recently requested Bitcoin payment address // CurrentAddress gets the most recently requested Bitcoin payment address
// from a wallet for a particular key-chain scope. If the address has already // from a wallet for a particular key-chain scope. If the address has already
// been used (there is at least one transaction spending to it in the // been used (there is at least one transaction spending to it in the
// blockchain or btcd mempool), the next chained address is returned. // blockchain or lbcd mempool), the next chained address is returned.
func (w *Wallet) CurrentAddress(account uint32, scope waddrmgr.KeyScope) (btcutil.Address, error) { func (w *Wallet) CurrentAddress(account uint32, scope waddrmgr.KeyScope) (btcutil.Address, error) {
chainClient, err := w.requireChainClient() chainClient, err := w.requireChainClient()
if err != nil { if err != nil {
@ -3492,8 +3492,8 @@ func (w *Wallet) publishTransaction(tx *wire.MsgTx) (*chainhash.Hash, error) {
// If the transaction is already in the mempool, we can just return now. // If the transaction is already in the mempool, we can just return now.
// //
// This error is returned when broadcasting/sending a transaction to a // This error is returned when broadcasting/sending a transaction to a
// btcd node that already has it in their mempool. // lbcd node that already has it in their mempool.
// https://github.com/btcsuite/btcd/blob/130ea5bddde33df32b06a1cdb42a6316eb73cff5/mempool/mempool.go#L953 // https://github.com/lbryio/lbcd/blob/130ea5bddde33df32b06a1cdb42a6316eb73cff5/mempool/mempool.go#L953
case match(err, "already have transaction"): case match(err, "already have transaction"):
fallthrough fallthrough
@ -3509,15 +3509,15 @@ func (w *Wallet) publishTransaction(tx *wire.MsgTx) (*chainhash.Hash, error) {
// in a sense successful. // in a sense successful.
// //
// This error is returned when sending a transaction that has already // This error is returned when sending a transaction that has already
// confirmed to a btcd/bitcoind node over RPC. // confirmed to a lbcd/bitcoind node over RPC.
// https://github.com/btcsuite/btcd/blob/130ea5bddde33df32b06a1cdb42a6316eb73cff5/rpcserver.go#L3355 // https://github.com/lbryio/lbcd/blob/130ea5bddde33df32b06a1cdb42a6316eb73cff5/rpcserver.go#L3355
// https://github.com/bitcoin/bitcoin/blob/9bf5768dd628b3a7c30dd42b5ed477a92c4d3540/src/node/transaction.cpp#L36 // https://github.com/bitcoin/bitcoin/blob/9bf5768dd628b3a7c30dd42b5ed477a92c4d3540/src/node/transaction.cpp#L36
case rpcTxConfirmed: case rpcTxConfirmed:
fallthrough fallthrough
// This error is returned when broadcasting a transaction that has // This error is returned when broadcasting a transaction that has
// already confirmed to a btcd node over the P2P network. // already confirmed to a lbcd node over the P2P network.
// https://github.com/btcsuite/btcd/blob/130ea5bddde33df32b06a1cdb42a6316eb73cff5/mempool/mempool.go#L1036 // https://github.com/lbryio/lbcd/blob/130ea5bddde33df32b06a1cdb42a6316eb73cff5/mempool/mempool.go#L1036
case match(err, "transaction already exists"): case match(err, "transaction already exists"):
fallthrough fallthrough
@ -3544,23 +3544,23 @@ func (w *Wallet) publishTransaction(tx *wire.MsgTx) (*chainhash.Hash, error) {
// transaction already in the mempool or in the chain, we'll remove it // transaction already in the mempool or in the chain, we'll remove it
// from the store and return an error. // from the store and return an error.
// //
// This error is returned from btcd when there is already a transaction // This error is returned from lbcd when there is already a transaction
// not signaling replacement in the mempool that spends one of the // not signaling replacement in the mempool that spends one of the
// referenced outputs. // referenced outputs.
// https://github.com/btcsuite/btcd/blob/130ea5bddde33df32b06a1cdb42a6316eb73cff5/mempool/mempool.go#L591 // https://github.com/lbryio/lbcd/blob/130ea5bddde33df32b06a1cdb42a6316eb73cff5/mempool/mempool.go#L591
case match(err, "already spent"): case match(err, "already spent"):
fallthrough fallthrough
// This error is returned from btcd when a referenced output cannot be // This error is returned from lbcd when a referenced output cannot be
// found, meaning it etiher has been spent or doesn't exist. // found, meaning it etiher has been spent or doesn't exist.
// https://github.com/btcsuite/btcd/blob/130ea5bddde33df32b06a1cdb42a6316eb73cff5/blockchain/chain.go#L405 // https://github.com/lbryio/lbcd/blob/130ea5bddde33df32b06a1cdb42a6316eb73cff5/blockchain/chain.go#L405
case match(err, "already been spent"): case match(err, "already been spent"):
fallthrough fallthrough
// This error is returned from btcd when a transaction is spending // This error is returned from lbcd when a transaction is spending
// either output that is missing or already spent, and orphans aren't // either output that is missing or already spent, and orphans aren't
// allowed. // allowed.
// https://github.com/btcsuite/btcd/blob/130ea5bddde33df32b06a1cdb42a6316eb73cff5/mempool/mempool.go#L1409 // https://github.com/lbryio/lbcd/blob/130ea5bddde33df32b06a1cdb42a6316eb73cff5/mempool/mempool.go#L1409
case match(err, "orphan transaction"): case match(err, "orphan transaction"):
fallthrough fallthrough
@ -3608,13 +3608,13 @@ func (w *Wallet) publishTransaction(tx *wire.MsgTx) (*chainhash.Hash, error) {
case match(err, "replacement-adds-unconfirmed"): case match(err, "replacement-adds-unconfirmed"):
fallthrough fallthrough
// Returned by btcd when replacement transaction was rejected for // Returned by lbcd when replacement transaction was rejected for
// whatever reason. // whatever reason.
// https://github.com/btcsuite/btcd/blob/130ea5bddde33df32b06a1cdb42a6316eb73cff5/mempool/mempool.go#L841 // https://github.com/lbryio/lbcd/blob/130ea5bddde33df32b06a1cdb42a6316eb73cff5/mempool/mempool.go#L841
// https://github.com/btcsuite/btcd/blob/130ea5bddde33df32b06a1cdb42a6316eb73cff5/mempool/mempool.go#L854 // https://github.com/lbryio/lbcd/blob/130ea5bddde33df32b06a1cdb42a6316eb73cff5/mempool/mempool.go#L854
// https://github.com/btcsuite/btcd/blob/130ea5bddde33df32b06a1cdb42a6316eb73cff5/mempool/mempool.go#L875 // https://github.com/lbryio/lbcd/blob/130ea5bddde33df32b06a1cdb42a6316eb73cff5/mempool/mempool.go#L875
// https://github.com/btcsuite/btcd/blob/130ea5bddde33df32b06a1cdb42a6316eb73cff5/mempool/mempool.go#L896 // https://github.com/lbryio/lbcd/blob/130ea5bddde33df32b06a1cdb42a6316eb73cff5/mempool/mempool.go#L896
// https://github.com/btcsuite/btcd/blob/130ea5bddde33df32b06a1cdb42a6316eb73cff5/mempool/mempool.go#L913 // https://github.com/lbryio/lbcd/blob/130ea5bddde33df32b06a1cdb42a6316eb73cff5/mempool/mempool.go#L913
case match(err, "replacement transaction"): case match(err, "replacement transaction"):
returnErr = &ErrReplacement{ returnErr = &ErrReplacement{
backendError: err, backendError: err,
@ -3655,7 +3655,7 @@ func (w *Wallet) ChainParams() *chaincfg.Params {
} }
// Database returns the underlying walletdb database. This method is provided // Database returns the underlying walletdb database. This method is provided
// in order to allow applications wrapping btcwallet to store app-specific data // in order to allow applications wrapping lbcwallet to store app-specific data
// with the wallet's database. // with the wallet's database.
func (w *Wallet) Database() walletdb.DB { func (w *Wallet) Database() walletdb.DB {
return w.db return w.db

View file

@ -5,10 +5,9 @@ import (
"testing" "testing"
"time" "time"
"github.com/btcsuite/btcwallet/walletdb" btcutil "github.com/lbryio/lbcutil"
"github.com/btcsuite/btcwallet/wtxmgr" "github.com/lbryio/lbcwallet/walletdb"
"github.com/lbryio/lbcwallet/wtxmgr"
"github.com/btcsuite/btcutil"
) )
var ( var (

View file

@ -10,8 +10,8 @@ import (
"testing" "testing"
"time" "time"
"github.com/btcsuite/btcd/chaincfg" "github.com/lbryio/lbcd/chaincfg"
_ "github.com/btcsuite/btcwallet/walletdb/bdb" _ "github.com/lbryio/lbcwallet/walletdb/bdb"
) )
// TestCreateWatchingOnly checks that we can construct a watching-only // TestCreateWatchingOnly checks that we can construct a watching-only

View file

@ -1,10 +1,10 @@
walletdb walletdb
======== ========
[![Build Status](https://travis-ci.org/btcsuite/btcwallet.png?branch=master)] [![Build Status](https://travis-ci.org/lbryio/lbcwallet.png?branch=master)]
(https://travis-ci.org/btcsuite/btcwallet) (https://travis-ci.org/lbryio/lbcwallet)
Package walletdb provides a namespaced database interface for btcwallet. Package walletdb provides a namespaced database interface for lbcwallet.
A wallet essentially consists of a multitude of stored data such as private A wallet essentially consists of a multitude of stored data such as private
and public keys, key derivation bits, pay-to-script-hash scripts, and various and public keys, key derivation bits, pay-to-script-hash scripts, and various
@ -43,27 +43,27 @@ boltdb project at https://github.com/boltdb/bolt by Ben B. Johnson.
## Documentation ## Documentation
[![GoDoc](https://godoc.org/github.com/btcsuite/btcwallet/walletdb?status.png)] [![GoDoc](https://godoc.org/github.com/lbryio/lbcwallet/walletdb?status.png)]
(http://godoc.org/github.com/btcsuite/btcwallet/walletdb) (http://godoc.org/github.com/lbryio/lbcwallet/walletdb)
Full `go doc` style documentation for the project can be viewed online without Full `go doc` style documentation for the project can be viewed online without
installing this package by using the GoDoc site here: installing this package by using the GoDoc site here:
http://godoc.org/github.com/btcsuite/btcwallet/walletdb http://godoc.org/github.com/lbryio/lbcwallet/walletdb
You can also view the documentation locally once the package is installed with You can also view the documentation locally once the package is installed with
the `godoc` tool by running `godoc -http=":6060"` and pointing your browser to the `godoc` tool by running `godoc -http=":6060"` and pointing your browser to
http://localhost:6060/pkg/github.com/btcsuite/btcwallet/walletdb http://localhost:6060/pkg/github.com/lbryio/lbcwallet/walletdb
## Installation ## Installation
```bash ```bash
$ go get github.com/btcsuite/btcwallet/walletdb $ go get github.com/lbryio/lbcwallet/walletdb
``` ```
## Examples ## Examples
* [Basic Usage Example] * [Basic Usage Example]
(http://godoc.org/github.com/btcsuite/btcwallet/walletdb#example-package--BasicUsage) (http://godoc.org/github.com/lbryio/lbcwallet/walletdb#example-package--BasicUsage)
Demonstrates creating a new database, getting a namespace from it, and using a Demonstrates creating a new database, getting a namespace from it, and using a
managed read-write transaction against the namespace to store and retrieve managed read-write transaction against the namespace to store and retrieve
data. data.

View file

@ -1,8 +1,8 @@
bdb bdb
=== ===
[![Build Status](https://travis-ci.org/btcsuite/btcwallet.png?branch=master)] [![Build Status](https://travis-ci.org/lbryio/lbcwallet.png?branch=master)]
(https://travis-ci.org/btcsuite/btcwallet) (https://travis-ci.org/lbryio/lbcwallet)
Package bdb implements an driver for walletdb that uses boltdb for the backing Package bdb implements an driver for walletdb that uses boltdb for the backing
datastore. Package bdb is licensed under the copyfree ISC license. datastore. Package bdb is licensed under the copyfree ISC license.
@ -31,16 +31,16 @@ if err != nil {
## Documentation ## Documentation
[![GoDoc](https://godoc.org/github.com/btcsuite/btcwallet/walletdb/bdb?status.png)] [![GoDoc](https://godoc.org/github.com/lbryio/lbcwallet/walletdb/bdb?status.png)]
(http://godoc.org/github.com/btcsuite/btcwallet/walletdb/bdb) (http://godoc.org/github.com/lbryio/lbcwallet/walletdb/bdb)
Full `go doc` style documentation for the project can be viewed online without Full `go doc` style documentation for the project can be viewed online without
installing this package by using the GoDoc site here: installing this package by using the GoDoc site here:
http://godoc.org/github.com/btcsuite/btcwallet/walletdb/bdb http://godoc.org/github.com/lbryio/lbcwallet/walletdb/bdb
You can also view the documentation locally once the package is installed with You can also view the documentation locally once the package is installed with
the `godoc` tool by running `godoc -http=":6060"` and pointing your browser to the `godoc` tool by running `godoc -http=":6060"` and pointing your browser to
http://localhost:6060/pkg/github.com/btcsuite/btcwallet/walletdb/bdb http://localhost:6060/pkg/github.com/lbryio/lbcwallet/walletdb/bdb
## License ## License

View file

@ -9,7 +9,7 @@ import (
"os" "os"
"time" "time"
"github.com/btcsuite/btcwallet/walletdb" "github.com/lbryio/lbcwallet/walletdb"
"go.etcd.io/bbolt" "go.etcd.io/bbolt"
) )

View file

@ -8,7 +8,7 @@ import (
"fmt" "fmt"
"time" "time"
"github.com/btcsuite/btcwallet/walletdb" "github.com/lbryio/lbcwallet/walletdb"
) )
const ( const (

View file

@ -13,8 +13,8 @@ import (
"testing" "testing"
"time" "time"
"github.com/btcsuite/btcwallet/walletdb" "github.com/lbryio/lbcwallet/walletdb"
_ "github.com/btcsuite/btcwallet/walletdb/bdb" _ "github.com/lbryio/lbcwallet/walletdb/bdb"
) )
const ( const (

View file

@ -18,7 +18,7 @@ import (
"path/filepath" "path/filepath"
"testing" "testing"
"github.com/btcsuite/btcwallet/walletdb/walletdbtest" "github.com/lbryio/lbcwallet/walletdb/walletdbtest"
) )
// TestInterface performs all interfaces tests for this database driver. // TestInterface performs all interfaces tests for this database driver.

View file

@ -12,8 +12,8 @@ import (
"testing" "testing"
"time" "time"
"github.com/btcsuite/btcwallet/walletdb" "github.com/lbryio/lbcwallet/walletdb"
_ "github.com/btcsuite/btcwallet/walletdb/bdb" _ "github.com/lbryio/lbcwallet/walletdb/bdb"
) )
var ( var (

View file

@ -3,7 +3,7 @@
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
/* /*
Package walletdb provides a namespaced database interface for btcwallet. Package walletdb provides a namespaced database interface for lbcwallet.
Overview Overview

View file

@ -10,8 +10,8 @@ import (
"os" "os"
"path/filepath" "path/filepath"
"github.com/btcsuite/btcwallet/walletdb" "github.com/lbryio/lbcwallet/walletdb"
_ "github.com/btcsuite/btcwallet/walletdb/bdb" _ "github.com/lbryio/lbcwallet/walletdb/bdb"
) )
// This example demonstrates creating a new database. // This example demonstrates creating a new database.
@ -19,8 +19,8 @@ func ExampleCreate() {
// This example assumes the bdb (bolt db) driver is imported. // This example assumes the bdb (bolt db) driver is imported.
// //
// import ( // import (
// "github.com/btcsuite/btcwallet/walletdb" // "github.com/lbryio/lbcwallet/walletdb"
// _ "github.com/btcsuite/btcwallet/walletdb/bdb" // _ "github.com/lbryio/lbcwallet/walletdb/bdb"
// ) // )
// Create a database and schedule it to be closed and removed on exit. // Create a database and schedule it to be closed and removed on exit.
@ -102,8 +102,8 @@ func Example_basicUsage() {
// This example assumes the bdb (bolt db) driver is imported. // This example assumes the bdb (bolt db) driver is imported.
// //
// import ( // import (
// "github.com/btcsuite/btcwallet/walletdb" // "github.com/lbryio/lbcwallet/walletdb"
// _ "github.com/btcsuite/btcwallet/walletdb/bdb" // _ "github.com/lbryio/lbcwallet/walletdb/bdb"
// ) // )
// Create a database and schedule it to be closed and removed on exit. // Create a database and schedule it to be closed and removed on exit.

View file

@ -4,7 +4,7 @@ import (
"errors" "errors"
"sort" "sort"
"github.com/btcsuite/btcwallet/walletdb" "github.com/lbryio/lbcwallet/walletdb"
) )
var ( var (

View file

@ -6,9 +6,9 @@ import (
"reflect" "reflect"
"testing" "testing"
"github.com/btcsuite/btcwallet/walletdb"
"github.com/btcsuite/btcwallet/walletdb/migration"
"github.com/davecgh/go-spew/spew" "github.com/davecgh/go-spew/spew"
"github.com/lbryio/lbcwallet/walletdb"
"github.com/lbryio/lbcwallet/walletdb/migration"
) )
type mockMigrationManager struct { type mockMigrationManager struct {

Some files were not shown because too many files have changed in this diff Show more