diff --git a/.gitignore b/.gitignore index 06e6431..c8a723d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -btcwallet +lbcwallet vendor .idea .vscode diff --git a/CHANGES b/CHANGES index 93acaa9..fdd8a9f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,17 +1,17 @@ ============================================================================ -User visible changes for btcwallet - A wallet daemon for btcd, written in Go +User visible changes for lbcwallet + A wallet daemon for lbcd, written in Go ============================================================================ Changes in 0.7.0 (Mon Nov 23 2015) - 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) - Bug fixes: - Removed data races in the RPC server (#292) and waddrmgr package (#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) - Fixed signmessage and verifymessage algorithm to match the equivalent algorithms used by Core (#324) @@ -29,7 +29,7 @@ Changes in 0.7.0 (Mon Nov 23 2015) - Miscellaneous: - Updated websocket notification handlers to latest API required by - btcd (#294) + lbcd (#294) - Enabled the logging subsystem of the rpcclient package (#328) - 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 account in Bitcoin Core Wallet default to "default", the name of the 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 Bitcoin Core Wallet. A new RPC API is being planned to rectify this (#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 rescan (#234) - 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: - Handle chain reorgs by unconfirming transactions from removed blocks (#248) - 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 be renamed back to "" or "default" by removing the special case naming 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. - 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 store (#217, #234) - Add Cursor API to walletdb for forwards and backwards iteration over a bucket (included in #234) - Factor out much of main's wallet.go into a wallet package (#213, #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 from descriptions in the internal/rpchelp package and saved as 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. - Add additional features to the votingpool package: - 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) - getreceivedbyaddress - 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: - getbestblockhash - getblockcount @@ -203,14 +203,14 @@ Changes in 0.5.0 (Tue Mar 03 2015) - Throttle the number of connected HTTP POST and websocket client connections (tunable using the rpcmaxclients and rpcmaxwebsockets config 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 - Rescan improvements: - Add a rescan notification for when the rescan has completed and no more rescan notifications are expected (#99) - 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 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 transaction spends one (#91) - 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 duplicate and missing blocks in the transaction store when middle inserting transactions from a new block @@ -239,9 +239,9 @@ Changes in 0.5.0 (Tue Mar 03 2015) transactions (#89) - Return the correct UTXO set when fetching all wallet UTXOs by fixing an 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 - 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 empty, non-nil Go slices - 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 - Refactor the RPC server: - 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 - Begin creating websocket notifications by sending to one of many notification channels in the rpcServer struct, which are in turn marshalled and broadcast to each websocket client - 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 - Uses an unbounded queue for waiting notifications - 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 particular error was left unchecked - 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 for quick lookup of any UTXO and access to the full wallet UTXO set without iterating over many transactions looking for unspent credits @@ -280,7 +280,7 @@ Changes in 0.5.0 (Tue Mar 03 2015) - Miscellaneous: - Rewrite paths relative to the data directory when an alternate data 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 encourage watching for expected payments by using listunspent - 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 - Only log rollbacks if transactions are reorged out of the old chain - 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) - Implement the following standard bitcoin server RPC requests: - - signmessage (https://github.com/conformal/btcwallet/issues/58) - - verifymessage (https://github.com/conformal/btcwallet/issues/61) - - listunspent (https://github.com/conformal/btcwallet/issues/54) - - validateaddress (https://github.com/conformal/btcwallet/issues/60) - - addressmultisig (https://github.com/conformal/btcwallet/issues/37) - - createmultisig (https://github.com/conformal/btcwallet/issues/37) - - signrawtransaction (https://github.com/conformal/btcwallet/issues/59) + - signmessage (https://github.com/lbryio/lbcwallet/issues/58) + - verifymessage (https://github.com/lbryio/lbcwallet/issues/61) + - listunspent (https://github.com/lbryio/lbcwallet/issues/54) + - validateaddress (https://github.com/lbryio/lbcwallet/issues/60) + - addressmultisig (https://github.com/lbryio/lbcwallet/issues/37) + - createmultisig (https://github.com/lbryio/lbcwallet/issues/37) + - signrawtransaction (https://github.com/lbryio/lbcwallet/issues/59) - Add authenticate extension RPC request to authenticate a websocket 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 - btcd websocket RPC server + lbcd websocket RPC server - 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 representation of large integer values @@ -327,14 +327,14 @@ Changes in 0.4.0 (Sun May 25 2014) to a length of 32 - 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 - 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 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): - Update listtransactions results to use "generate" category for @@ -354,17 +354,17 @@ Changes in 0.4.0 (Sun May 25 2014) - Merge waiting rescan jobs so all jobs can be handled with a single rescan - Support parially synced addresses in the keystore and incrementally - mark rescan progress. If a rescan is unable to continue (wallet - closes, btcd disconnects, etc.) a new rescan can start at the last + mark rescan progress. If a rescan is unable to continue (wallet + closes, lbcd disconnects, etc.) a new rescan can start at the last synced chain height - - Notify (with an unsolicited notification) websocket clients of btcd + - Notify (with an unsolicited notification) websocket clients of lbcd connection state - Improve logging: - 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 corrections @@ -372,13 +372,13 @@ Changes in 0.4.0 (Sun May 25 2014) Changes in 0.3.0 (Mon Feb 10 2014) - Use correct hash algorithm for chained addresses (fixes a bug where 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 account locking to greatly reduce btcwallet lockups caused by + - Redo account locking to greatly reduce lbcwallet lockups caused by incorrect mutex usage - 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 - Implement the following standard bitcoin server RPC requests: - - getinfo (https://github.com/conformal/btcwallet/issues/63) - - getrawchangeaddress (https://github.com/conformal/btcwallet/issues/41) - - getreceivedbyaccount (https://github.com/conformal/btcwallet/issues/42) - - gettransaction (https://github.com/conformal/btcwallet/issues/44) - - keypoolrefill (https://github.com/conformal/btcwallet/issues/48) - - listsinceblock (https://github.com/conformal/btcwallet/issues/52) - - sendtoaddress (https://github.com/conformal/btcwallet/issues/56) + - getinfo (https://github.com/lbryio/lbcwallet/issues/63) + - getrawchangeaddress (https://github.com/lbryio/lbcwallet/issues/41) + - getreceivedbyaccount (https://github.com/lbryio/lbcwallet/issues/42) + - gettransaction (https://github.com/lbryio/lbcwallet/issues/44) + - keypoolrefill (https://github.com/lbryio/lbcwallet/issues/48) + - listsinceblock (https://github.com/lbryio/lbcwallet/issues/52) + - sendtoaddress (https://github.com/lbryio/lbcwallet/issues/56) - 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 - getwork - stop - Add RPC extension request, exportwatchingwallet, to export an account 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 @@ -418,16 +418,16 @@ Changes in 0.3.0 (Mon Feb 10 2014) - Allow opening accounts with watching-only wallets - 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 - (https://github.com/conformal/btcwallet/issues/34) + (https://github.com/lbryio/lbcwallet/issues/34) - 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 - 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 pair @@ -446,19 +446,19 @@ Changes in 0.3.0 (Mon Feb 10 2014) - Fix typos in README file 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 Changes in 0.2.0 (Thu Jan 09 2014) - 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 - remote btcd instance - (https://github.com/conformal/btcwallet/issues/1) + remote lbcd instance + (https://github.com/lbryio/lbcwallet/issues/1) - 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 - 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 - - Detect and rollback saved tx/utxo info after btcd performs blockchain - reorganizations while btcwallet was disconnected + - Detect and rollback saved tx/utxo info after lbcd performs blockchain + reorganizations while lbcwallet was disconnected - 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 - getaccountaddress - - importprivkey (https://github.com/conformal/btcwallet/issues/2) - - listtransactions (https://github.com/conformal/btcwallet/issues/12) + - importprivkey (https://github.com/lbryio/lbcwallet/issues/2) + - listtransactions (https://github.com/lbryio/lbcwallet/issues/12) - Add several extension RPC calls for websocket connections: - getaddressbalance: get the balance associated with a single address - getunconfirmedbalance: get total balance for unconfirmed transactions - 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 - Make RPC extensions available only to websocket connections, with the exception of createencryptedwallet - 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 @@ -495,22 +495,22 @@ Changes in 0.2.0 (Thu Jan 09 2014) - Use OS-specific rename calls to provide atomic file renames which 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 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 a bug where the RPC server hung on requests requiring btcd - when a btcd connection was never established + - Fix a bug where the RPC server hung on requests requiring lbcd + when a lbcd connection was never established - 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 - (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 trailing ending 0s diff --git a/Makefile b/Makefile index b09ca72..cc40654 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -PKG := github.com/btcsuite/btcwallet +PKG := github.com/lbryio/lbcwallet LINT_PKG := github.com/golangci/golangci-lint/cmd/golangci-lint GOACC_PKG := github.com/ory/go-acc @@ -14,7 +14,7 @@ GOACC_COMMIT := 80342ae2e0fcf265e99e76bcc4efd022c7c3811b DEPGET := cd /tmp && GO111MODULE=on go get -v GOBUILD := GO111MODULE=on go build -v GOINSTALL := GO111MODULE=on go install -v -GOTEST := GO111MODULE=on go test +GOTEST := GO111MODULE=on go test GOLIST := go list -deps $(PKG)/... | grep '$(PKG)' GOLIST_COVER := $$(go list -deps $(PKG)/... | grep '$(PKG)') @@ -64,11 +64,11 @@ goimports: # ============ build: - @$(call print, "Compiling btcwallet.") + @$(call print, "Compiling lbcwallet.") $(GOBUILD) $(PKG)/... install: - @$(call print, "Installing btcwallet.") + @$(call print, "Installing lbcwallet.") $(GOINSTALL) $(PKG) $(GOINSTALL) $(PKG)/cmd/dropwtxmgr $(GOINSTALL) $(PKG)/cmd/sweepaccount diff --git a/README.md b/README.md index b7cb2c5..89e45d4 100644 --- a/README.md +++ b/README.md @@ -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://ci.appveyor.com/api/projects/status/88nxvckdj8upqr36/branch/master?svg=true)](https://ci.appveyor.com/project/jrick/btcwallet/branch/master) +[![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/lbcwallet/branch/master) -btcwallet is a daemon handling bitcoin wallet functionality for a -single user. It acts as both an RPC client to btcd and an RPC server +lbcwallet is a daemon handling bitcoin wallet functionality for a +single user. It acts as both an RPC client to and an RPC server for wallet clients and legacy RPC applications. Public and private keys are derived using the hierarchical deterministic format described by [BIP0032](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki). Unencrypted private keys are not supported and are never written to -disk. btcwallet uses the +disk. lbcwallet uses the `m/44'/'/'//
` HD path for all derived addresses, as described by [BIP0044](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki). 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 wallet file is compromised without exposing all current and future 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 encryption will extend to transactions as well. -btcwallet is not an SPV client and requires connecting to a local or -remote btcd instance for asynchronous blockchain queries and -notifications over websockets. Full btcd installation instructions -can be found [here](https://github.com/btcsuite/btcd). An alternative -SPV mode that is compatible with btcd and Bitcoin Core is planned for +lbcwallet is not an SPV client and requires connecting to a local or +remote instance for asynchronous blockchain queries and +notifications over websockets. Full installation instructions +can be found [here](https://github.com/lbryio/lbcd). An alternative +SPV mode that is compatible with and Bitcoin Core is planned for a future release. 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 - 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 (`--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 @@ -64,9 +64,9 @@ Wallet clients can use one of two RPC servers: 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 @@ -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 `$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 -$ cd $GOPATH/src/github.com/btcsuite/btcwallet +$ cd $GOPATH/src/github.com/lbryio/lbcwallet $ 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, we recommend you do so now. @@ -104,75 +104,75 @@ Install a newer MSI #### 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 -$ cd $GOPATH/src/github.com/btcsuite/btcwallet +$ cd $GOPATH/src/github.com/lbryio/lbcwallet $ git pull $ GO111MODULE=on go install -v . ./cmd/... ``` ## Getting Started -The following instructions detail how to get started with btcwallet connecting -to a localhost btcd. Commands should be run in `cmd.exe` or PowerShell on +The following instructions detail how to get started with lbcwallet connecting +to a localhost . Commands should be run in `cmd.exe` or PowerShell on 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: ``` -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 -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. PowerShell (Installed from MSI): ``` -PS> cp "$env:ProgramFiles\Btcd Suite\Btcd\sample-btcd.conf" $env:LOCALAPPDATA\Btcd\btcd.conf -PS> cp "$env:ProgramFiles\Btcd Suite\Btcwallet\sample-btcwallet.conf" $env:LOCALAPPDATA\Btcwallet\btcwallet.conf -PS> $editor $env:LOCALAPPDATA\Btcd\btcd.conf -PS> $editor $env:LOCALAPPDATA\Btcwallet\btcwallet.conf +PS> cp "$env:ProgramFiles\Lbcd Suite\Lbcd\sample-lbcd.conf" $env:LOCALAPPDATA\Lbcd\.conf +PS> cp "$env:ProgramFiles\Lbcd Suite\lbcwallet\sample-lbcwallet.conf" $env:LOCALAPPDATA\lbcwallet\lbcwallet.conf +PS> $editor $env:LOCALAPPDATA\Lbcd\lbcd.conf +PS> $editor $env:LOCALAPPDATA\lbcwallet\lbcwallet.conf ``` 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\btcsuite\btcwallet\sample-btcwallet.conf $env:LOCALAPPDATA\Btcwallet\btcwallet.conf -PS> $editor $env:LOCALAPPDATA\Btcd\btcd.conf -PS> $editor $env:LOCALAPPDATA\Btcwallet\btcwallet.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\lbryio\lbcwallet\sample-lbcwallet.conf $env:LOCALAPPDATA\lbcwallet\lbcwallet.conf +PS> $editor $env:LOCALAPPDATA\Lbcd\lbcd.conf +PS> $editor $env:LOCALAPPDATA\lbcwallet\lbcwallet.conf ``` Linux/BSD/POSIX (Installed from source): ```bash -$ cp $GOPATH/src/github.com/btcsuite/btcd/sample-btcd.conf ~/.btcd/btcd.conf -$ cp $GOPATH/src/github.com/btcsuite/btcwallet/sample-btcwallet.conf ~/.btcwallet/btcwallet.conf -$ $EDITOR ~/.btcd/btcd.conf -$ $EDITOR ~/.btcwallet/btcwallet.conf +$ cp $GOPATH/src/github.com/lbryio/lbcd/sample-.conf ~/./.conf +$ cp $GOPATH/src/github.com/lbryio/lbcwallet/sample-lbcwallet.conf ~/.lbcwallet/lbcwallet.conf +$ $EDITOR ~/./.conf +$ $EDITOR ~/.lbcwallet/lbcwallet.conf ``` ## 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. ## GPG Verification Key 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: - Download the public key from the Conformal website at @@ -191,4 +191,4 @@ verify the signature perform the following: ## License -btcwallet is licensed under the liberal ISC License. +lbcwallet is licensed under the liberal ISC License. diff --git a/chain/block_filterer.go b/chain/block_filterer.go index d080677..dfcdbb4 100644 --- a/chain/block_filterer.go +++ b/chain/block_filterer.go @@ -1,11 +1,11 @@ package chain import ( - "github.com/btcsuite/btcd/chaincfg" - "github.com/btcsuite/btcd/txscript" - "github.com/btcsuite/btcd/wire" - "github.com/btcsuite/btcutil" - "github.com/btcsuite/btcwallet/waddrmgr" + "github.com/lbryio/lbcd/chaincfg" + "github.com/lbryio/lbcd/txscript" + "github.com/lbryio/lbcd/wire" + btcutil "github.com/lbryio/lbcutil" + "github.com/lbryio/lbcwallet/waddrmgr" ) // BlockFilterer is used to iteratively scan blocks for a set of addresses of diff --git a/chain/block_filterer_test.go b/chain/block_filterer_test.go index 7b9e222..2923337 100644 --- a/chain/block_filterer_test.go +++ b/chain/block_filterer_test.go @@ -5,11 +5,11 @@ import ( "testing" "time" - "github.com/btcsuite/btcd/chaincfg" - "github.com/btcsuite/btcd/chaincfg/chainhash" - "github.com/btcsuite/btcd/wire" - "github.com/btcsuite/btcutil" - "github.com/btcsuite/btcwallet/chain" + "github.com/lbryio/lbcd/chaincfg" + "github.com/lbryio/lbcd/chaincfg/chainhash" + "github.com/lbryio/lbcd/wire" + btcutil "github.com/lbryio/lbcutil" + "github.com/lbryio/lbcwallet/chain" ) var Block100000 = wire.MsgBlock{ diff --git a/chain/interface.go b/chain/interface.go index 3e8c8a7..972af7f 100644 --- a/chain/interface.go +++ b/chain/interface.go @@ -3,11 +3,11 @@ package chain import ( "time" - "github.com/btcsuite/btcd/chaincfg/chainhash" - "github.com/btcsuite/btcd/wire" - "github.com/btcsuite/btcutil" - "github.com/btcsuite/btcwallet/waddrmgr" - "github.com/btcsuite/btcwallet/wtxmgr" + "github.com/lbryio/lbcd/chaincfg/chainhash" + "github.com/lbryio/lbcd/wire" + btcutil "github.com/lbryio/lbcutil" + "github.com/lbryio/lbcwallet/waddrmgr" + "github.com/lbryio/lbcwallet/wtxmgr" ) // 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 { return []string{ "bitcoind", - "btcd", + "", } } // 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. type Interface interface { Start() error diff --git a/chain/neutrino.go b/chain/neutrino.go index 0080559..0e7332d 100644 --- a/chain/neutrino.go +++ b/chain/neutrino.go @@ -1,7 +1,7 @@ package chain import ( - "github.com/btcsuite/btcd/txscript" + "github.com/lbryio/lbcd/txscript" ) // buildFilterBlocksWatchList constructs a watchlist used for matching against a diff --git a/chain/rpc.go b/chain/rpc.go index eafb63e..4f63959 100644 --- a/chain/rpc.go +++ b/chain/rpc.go @@ -9,16 +9,16 @@ import ( "sync" "time" - "github.com/btcsuite/btcd/btcjson" - "github.com/btcsuite/btcd/chaincfg" - "github.com/btcsuite/btcd/chaincfg/chainhash" - "github.com/btcsuite/btcd/rpcclient" - "github.com/btcsuite/btcd/wire" - "github.com/btcsuite/btcutil" - "github.com/btcsuite/btcutil/gcs" - "github.com/btcsuite/btcutil/gcs/builder" - "github.com/btcsuite/btcwallet/waddrmgr" - "github.com/btcsuite/btcwallet/wtxmgr" + "github.com/lbryio/lbcd/btcjson" + "github.com/lbryio/lbcd/chaincfg" + "github.com/lbryio/lbcd/chaincfg/chainhash" + "github.com/lbryio/lbcd/rpcclient" + "github.com/lbryio/lbcd/wire" + btcutil "github.com/lbryio/lbcutil" + "github.com/lbryio/lbcutil/gcs" + "github.com/lbryio/lbcutil/gcs/builder" + "github.com/lbryio/lbcwallet/waddrmgr" + "github.com/lbryio/lbcwallet/wtxmgr" ) // 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. func (c *RPCClient) BackEnd() string { - return "btcd" + return "" } // Start attempts to establish a client connection with the remote server. diff --git a/chain/utils_test.go b/chain/utils_test.go index 2c41c79..854818a 100644 --- a/chain/utils_test.go +++ b/chain/utils_test.go @@ -9,10 +9,10 @@ import ( "sync" "time" - "github.com/btcsuite/btcd/blockchain" - "github.com/btcsuite/btcd/chaincfg/chainhash" - "github.com/btcsuite/btcd/wire" - "github.com/btcsuite/btcutil" + "github.com/lbryio/lbcd/blockchain" + "github.com/lbryio/lbcd/chaincfg/chainhash" + "github.com/lbryio/lbcd/wire" + btcutil "github.com/lbryio/lbcutil" ) // 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. // // 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 { if len(txns) == 0 { return chainhash.Hash{} @@ -83,7 +83,7 @@ func calcMerkleRoot(txns []*wire.MsgTx) chainhash.Hash { // with the solution. False is returned if no solution exists. // // 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 { // sbResult is used by the solver goroutines to send results. type sbResult struct { diff --git a/cmd/dropwtxmgr/main.go b/cmd/dropwtxmgr/main.go index b474db1..1e5d487 100644 --- a/cmd/dropwtxmgr/main.go +++ b/cmd/dropwtxmgr/main.go @@ -11,17 +11,17 @@ import ( "path/filepath" "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" + btcutil "github.com/lbryio/lbcutil" + "github.com/lbryio/lbcwallet/wallet" + "github.com/lbryio/lbcwallet/walletdb" + _ "github.com/lbryio/lbcwallet/walletdb/bdb" ) const defaultNet = "mainnet" var ( - datadir = btcutil.AppDataDir("btcwallet", false) + datadir = btcutil.AppDataDir("lbcwallet", false) ) // Flags. @@ -74,7 +74,7 @@ func mainInt() int { } 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)) if !scanner.Scan() { @@ -105,7 +105,7 @@ func mainInt() int { } defer db.Close() - fmt.Println("Dropping btcwallet transaction history") + fmt.Println("Dropping lbcwallet transaction history") err = wallet.DropTransactionHistory(db, !opts.DropLabels) if err != nil { diff --git a/cmd/sweepaccount/main.go b/cmd/sweepaccount/main.go index 97a3841..c40b7a9 100644 --- a/cmd/sweepaccount/main.go +++ b/cmd/sweepaccount/main.go @@ -12,22 +12,22 @@ import ( "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/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 ( - walletDataDirectory = btcutil.AppDataDir("btcwallet", false) + walletDataDirectory = btcutil.AppDataDir("lbcwallet", false) newlineBytes = []byte{'\n'} ) diff --git a/config.go b/config.go index 22875bb..b379192 100644 --- a/config.go +++ b/config.go @@ -16,28 +16,28 @@ import ( "strings" "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" + "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 ( - defaultCAFilename = "btcd.cert" - defaultConfigFilename = "btcwallet.conf" + defaultCAFilename = "lbcd.cert" + defaultConfigFilename = "lbcwallet.conf" defaultLogLevel = "info" defaultLogDirname = "logs" - defaultLogFilename = "btcwallet.log" + defaultLogFilename = "lbcwallet.log" defaultRPCMaxClients = 10 defaultRPCMaxWebsockets = 25 ) var ( - btcdDefaultCAFile = filepath.Join(btcutil.AppDataDir("btcd", false), "rpc.cert") - defaultAppDataDir = btcutil.AppDataDir("btcwallet", false) + lbcdDefaultCAFile = filepath.Join(btcutil.AppDataDir("lbcd", false), "rpc.cert") + defaultAppDataDir = btcutil.AppDataDir("lbcwallet", false) defaultConfigFile = filepath.Join(defaultAppDataDir, defaultConfigFilename) defaultRPCKeyFile = filepath.Join(defaultAppDataDir, "rpc.key") 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"` // 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)"` - CAFile *cfgutil.ExplicitString `long:"cafile" description:"File containing root certificates to authenticate a TLS connections with btcd"` + 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 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"` - BtcdUsername string `long:"btcdusername" description:"Username for btcd authentication"` - BtcdPassword string `long:"btcdpassword" default-mask:"-" description:"Password for btcd authentication"` + LbcdUsername string `long:"lbcdusername" description:"Username for lbcd 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)"` ProxyUser string `long:"proxyuser" description:"Username 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)"` 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"` - Username string `short:"u" long:"username" description:"Username for legacy RPC and btcd authentication (if btcdusername is unset)"` - Password string `short:"P" long:"password" default-mask:"-" description:"Password for legacy RPC and btcd authentication (if btcdpassword 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 lbcd authentication (if lbcdpassword is unset)"` // EXPERIMENTAL RPC server options // @@ -253,7 +253,7 @@ func parseAndSetDebugLevels(debugLevel string) error { // 3) Load configuration file overwriting defaults with 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 // and command line options. Command line options always take precedence. func loadConfig() (*config, []string, error) { @@ -569,12 +569,12 @@ func loadConfig() (*config, []string, error) { return nil, nil, err } } 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() { cfg.CAFile.Value = filepath.Join(cfg.AppDataDir.Value, defaultCAFilename) // 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) if err != nil { fmt.Fprintln(os.Stderr, err) @@ -582,14 +582,14 @@ func loadConfig() (*config, []string, error) { } if !certExists { if _, ok := localhostListeners[RPCHost]; ok { - btcdCertExists, err := cfgutil.FileExists( - btcdDefaultCAFile) + lbcdCertExists, err := cfgutil.FileExists( + lbcdDefaultCAFile) if err != nil { fmt.Fprintln(os.Stderr, err) return nil, nil, err } - if btcdCertExists { - cfg.CAFile.Value = btcdDefaultCAFile + if lbcdCertExists { + cfg.CAFile.Value = lbcdDefaultCAFile } } } @@ -680,15 +680,15 @@ func loadConfig() (*config, []string, error) { cfg.RPCCert.Value = cleanAndExpandPath(cfg.RPCCert.Value) cfg.RPCKey.Value = cleanAndExpandPath(cfg.RPCKey.Value) - // If the btcd username or password are unset, use the same auth as for - // the client. The two settings were previously shared for btcd and + // If the lbcd username or password are unset, use the same auth as for + // the client. The two settings were previously shared for lbcd and // client auth, so this avoids breaking backwards compatibility while - // allowing users to use different auth settings for btcd and wallet. - if cfg.BtcdUsername == "" { - cfg.BtcdUsername = cfg.Username + // allowing users to use different auth settings for lbcd and wallet. + if cfg.LbcdUsername == "" { + cfg.LbcdUsername = cfg.Username } - if cfg.BtcdPassword == "" { - cfg.BtcdPassword = cfg.Password + if cfg.LbcdPassword == "" { + cfg.LbcdPassword = cfg.Password } // Warn about missing config file after the final command line parse diff --git a/deps.txt b/deps.txt index 1d57d04..607e3f5 100644 --- a/deps.txt +++ b/deps.txt @@ -1,10 +1,10 @@ Dependency Commits ================== -btcwallet 0.7.0 Alpha +lbcwallet 0.7.0 Alpha ---------------- bolt 1139dd23c5f9d1a28096b511959044b29364a3fe -btcd cea5d3c1cc16eb07a1686c557db23004655ae11b + cea5d3c1cc16eb07a1686c557db23004655ae11b btclog 5005b7240f310ae8f01c7664a3954d280241eb2b btcrpcclient b81555beeac8eda71e8150cc9d63631aaa756965 btcutil ff82dacded1c76d101bce55c394c03c0bbff69e8 @@ -15,9 +15,9 @@ golangcrypto 53f62d9b43e87a6c56975cf862af7edf33a8d0df seelog 313961b101eb55f65ae0f03ddd4e322731763b6c websocket 31079b6807923eb23992c421b114992b95131b55 -btcwallet 0.1.0 Alpha +lbcwallet 0.1.0 Alpha ---------------- -btcd 3108b944017b14a3c5863ed1401f1a2471907d84 + 3108b944017b14a3c5863ed1401f1a2471907d84 btcec a97fd5fe2c670030f8d77dc13b9fa8401ef9f349 btcjson d20f958c92e1444d83215c3cf98d6eef41898dcb btcscript f4a6449ad3b90d0c830bf2895b83ced8d5fb91e9 diff --git a/docs/README.md b/docs/README.md index eb89217..029dc11 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,3 +1,3 @@ ### 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) diff --git a/docs/force_rescans.md b/docs/force_rescans.md index a218ff7..42bc2ea 100644 --- a/docs/force_rescans.md +++ b/docs/force_rescans.md @@ -33,14 +33,14 @@ two situations when this holds true: 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, `dropwtxmgr`, is provided in the `cmd/dropwtxmgr` directory which may be used to 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: ``` -$ cd $GOPATH/src/github.com/btcsuite/btcwallet/cmd/dropwtxmgr +$ cd $GOPATH/src/github.com/lbryio/lbcwallet/cmd/dropwtxmgr $ go get ``` @@ -50,8 +50,8 @@ answering yes to the prompt: ``` $ dropwtxmgr -Database path: /home/username/.btcwallet/mainnet/wallet.db -Drop all btcwallet transaction history? [y/N] y +Database path: /home/username/.lbcwallet/mainnet/wallet.db +Drop all lbcwallet transaction history? [y/N] y Dropping wtxmgr namespace ``` @@ -60,17 +60,17 @@ different network (e.g. testnet or simnet) must be dropped, the full database path may be specified: ``` -$ dropwtxmgr --db ~/.btcwallet/testnet/wallet.db -Database path: /home/username/.btcwallet/testnet/wallet.db -Drop all btcwallet transaction history? [y/N] y +$ dropwtxmgr --db ~/.lbcwallet/testnet/wallet.db +Database path: /home/username/.lbcwallet/testnet/wallet.db +Drop all lbcwallet transaction history? [y/N] y 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: ``` -$ btcwallet +$ lbcwallet 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 diff --git a/goclean.sh b/goclean.sh index a01f733..cbbe2d6 100755 --- a/goclean.sh +++ b/goclean.sh @@ -7,7 +7,7 @@ set -ex -test_targets=$(go list -deps ./... | grep 'btcwallet') +test_targets=$(go list -deps ./... | grep 'lbcwallet') # Automatic checks test -z "$(go fmt $test_targets | tee /dev/stderr)" diff --git a/internal/cfgutil/amount.go b/internal/cfgutil/amount.go index 2e8aaf8..3d21a4e 100644 --- a/internal/cfgutil/amount.go +++ b/internal/cfgutil/amount.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/btcsuite/btcutil" + btcutil "github.com/lbryio/lbcutil" ) // 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. func (a *AmountFlag) UnmarshalFlag(value string) error { - value = strings.TrimSuffix(value, " BTC") + value = strings.TrimSuffix(value, " LBC") valueF64, err := strconv.ParseFloat(value, 64) if err != nil { return err diff --git a/internal/legacy/keystore/keystore.go b/internal/legacy/keystore/keystore.go index 2a58f0b..94637d1 100644 --- a/internal/legacy/keystore/keystore.go +++ b/internal/legacy/keystore/keystore.go @@ -24,13 +24,13 @@ import ( "golang.org/x/crypto/ripemd160" - "github.com/btcsuite/btcd/btcec" - "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/btcwallet/internal/legacy/rename" + "github.com/lbryio/lbcd/btcec" + "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/lbcwallet/internal/legacy/rename" ) const ( @@ -1731,7 +1731,7 @@ func (af *addrFlags) ReadFrom(r io.Reader) (int64, error) { af.partialSync = b[0]&(1<<7) != 0 // 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 // there may not be if the keypool was extended from just the last // 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 -// 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. type unusedSpace struct { nBytes int // number of unused bytes that armory left. diff --git a/internal/legacy/keystore/keystore_test.go b/internal/legacy/keystore/keystore_test.go index 3ef15e4..d857ee3 100644 --- a/internal/legacy/keystore/keystore_test.go +++ b/internal/legacy/keystore/keystore_test.go @@ -11,12 +11,12 @@ import ( "reflect" "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/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 = "" diff --git a/internal/prompt/prompt.go b/internal/prompt/prompt.go index 9f81dec..298b08c 100644 --- a/internal/prompt/prompt.go +++ b/internal/prompt/prompt.go @@ -15,8 +15,8 @@ import ( "os" "strings" - "github.com/btcsuite/btcutil/hdkeychain" - "github.com/btcsuite/btcwallet/internal/legacy/keystore" + "github.com/lbryio/lbcutil/hdkeychain" + "github.com/lbryio/lbcwallet/internal/legacy/keystore" "golang.org/x/crypto/ssh/terminal" ) diff --git a/internal/prompt/prompt_js.go b/internal/prompt/prompt_js.go index 674119d..2de6df2 100644 --- a/internal/prompt/prompt_js.go +++ b/internal/prompt/prompt_js.go @@ -8,7 +8,7 @@ import ( "bufio" "fmt" - "github.com/btcsuite/btcwallet/internal/legacy/keystore" + "github.com/lbryio/lbcwallet/internal/legacy/keystore" ) func ProvideSeed() ([]byte, error) { diff --git a/internal/rpchelp/genrpcserverhelp.go b/internal/rpchelp/genrpcserverhelp.go index 9a9c24b..98fbd28 100644 --- a/internal/rpchelp/genrpcserverhelp.go +++ b/internal/rpchelp/genrpcserverhelp.go @@ -13,8 +13,8 @@ import ( "os" "strings" - "github.com/btcsuite/btcd/btcjson" - "github.com/btcsuite/btcwallet/internal/rpchelp" + "github.com/lbryio/lbcd/btcjson" + "github.com/lbryio/lbcwallet/internal/rpchelp" ) var outputFile = func() *os.File { diff --git a/internal/rpchelp/helpdescs_en_US.go b/internal/rpchelp/helpdescs_en_US.go index 1af738a..bb874fb 100644 --- a/internal/rpchelp/helpdescs_en_US.go +++ b/internal/rpchelp/helpdescs_en_US.go @@ -74,7 +74,7 @@ var helpDescsEnUS = map[string]string{ "infowalletresult-proxy": "The proxy used by the server", "infowalletresult-difficulty": "The current target difficulty", "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-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", diff --git a/internal/rpchelp/methods.go b/internal/rpchelp/methods.go index ce037f7..ef7239f 100644 --- a/internal/rpchelp/methods.go +++ b/internal/rpchelp/methods.go @@ -7,7 +7,7 @@ package rpchelp -import "github.com/btcsuite/btcd/btcjson" +import "github.com/lbryio/lbcd/btcjson" // Common return types. var ( diff --git a/internal/zero/benchmark_test.go b/internal/zero/benchmark_test.go index ade0a90..70df61c 100644 --- a/internal/zero/benchmark_test.go +++ b/internal/zero/benchmark_test.go @@ -7,7 +7,7 @@ package zero_test import ( "testing" - . "github.com/btcsuite/btcwallet/internal/zero" + . "github.com/lbryio/lbcwallet/internal/zero" ) var ( diff --git a/internal/zero/zero_test.go b/internal/zero/zero_test.go index 996e838..be23483 100644 --- a/internal/zero/zero_test.go +++ b/internal/zero/zero_test.go @@ -10,7 +10,7 @@ import ( "strings" "testing" - . "github.com/btcsuite/btcwallet/internal/zero" + . "github.com/lbryio/lbcwallet/internal/zero" ) func makeOneBytes(n int) []byte { diff --git a/btcwallet.go b/lbcwallet.go similarity index 95% rename from btcwallet.go rename to lbcwallet.go index 7f2d780..8bafd54 100644 --- a/btcwallet.go +++ b/lbcwallet.go @@ -13,9 +13,9 @@ import ( "runtime" "sync" - "github.com/btcsuite/btcwallet/chain" - "github.com/btcsuite/btcwallet/rpc/legacyrpc" - "github.com/btcsuite/btcwallet/wallet" + "github.com/lbryio/lbcwallet/chain" + "github.com/lbryio/lbcwallet/rpc/legacyrpc" + "github.com/lbryio/lbcwallet/wallet" ) var ( @@ -225,14 +225,14 @@ func readCAFile() []byte { 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 // 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. func startChainRPC(certs []byte) (*chain.RPCClient, error) { log.Infof("Attempting RPC client connection to %v", 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 { return nil, err } diff --git a/log.go b/log.go index 19b4184..2bb0795 100644 --- a/log.go +++ b/log.go @@ -10,14 +10,14 @@ import ( "os" "path/filepath" - "github.com/btcsuite/btcd/rpcclient" "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/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 diff --git a/netparams/params.go b/netparams/params.go index f54781e..1dadfda 100644 --- a/netparams/params.go +++ b/netparams/params.go @@ -5,8 +5,8 @@ package netparams import ( - "github.com/btcsuite/btcd/chaincfg" - "github.com/btcsuite/btcd/wire" + "github.com/lbryio/lbcd/chaincfg" + "github.com/lbryio/lbcd/wire" ) // Params is used to group parameters for various networks such as the main @@ -17,16 +17,16 @@ type Params struct { RPCServerPort string } -// MainNetParams contains parameters specific running btcwallet and -// btcd on the main network (wire.MainNet). +// MainNetParams contains parameters specific running lbcwallet and +// on the main network (wire.MainNet). var MainNetParams = Params{ Params: &chaincfg.MainNetParams, RPCClientPort: "8334", RPCServerPort: "8332", } -// TestNet3Params contains parameters specific running btcwallet and -// btcd on the test network (version 3) (wire.TestNet3). +// TestNet3Params contains parameters specific running lbcwallet and +// on the test network (version 3) (wire.TestNet3). var TestNet3Params = Params{ Params: &chaincfg.TestNet3Params, RPCClientPort: "18334", diff --git a/params.go b/params.go index b668762..6860c44 100644 --- a/params.go +++ b/params.go @@ -4,6 +4,6 @@ package main -import "github.com/btcsuite/btcwallet/netparams" +import "github.com/lbryio/lbcwallet/netparams" var activeNet = &netparams.MainNetParams diff --git a/rpc/documentation/api.md b/rpc/documentation/api.md index 508d706..d6ed8cc 100644 --- a/rpc/documentation/api.md +++ b/rpc/documentation/api.md @@ -132,7 +132,7 @@ After creating a wallet, the `WalletService` service begins running. encryption. This passphrase protects data that is made public on the blockchain. If this passphrase has zero length, an insecure default is used instead. - + - `bytes private_passphrase`: The passphrase used for the inner wallet encryption. This is the passphrase used for data that must always remain private, such as private keys. The length of this field must not be zero. @@ -212,14 +212,14 @@ ___ #### `StartConsensusRpc` 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. **Request:** `StartConsensusRpcRequest` - `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 - 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. - `string username`: The RPC username required to authenticate to the RPC @@ -259,23 +259,39 @@ or opened yet. The service provides the following methods: -- [`Ping`](#ping) -- [`Network`](#network) -- [`AccountNumber`](#accountnumber) -- [`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) +- [RPC API Specification](#rpc-api-specification) +- [Version: 2.0.1](#version-201) + - [`VersionService`](#versionservice) + - [Methods](#methods) + - [`Version`](#version) + - [`LoaderService`](#loaderservice) + - [Methods](#methods-1) + - [`WalletExists`](#walletexists) + - [`CreateWallet`](#createwallet) + - [`OpenWallet`](#openwallet) + - [`CloseWallet`](#closewallet) + - [`StartConsensusRpc`](#startconsensusrpc) + - [`WalletService`](#walletservice) + - [`Ping`](#ping) + - [`Network`](#network) + - [`AccountNumber`](#accountnumber) + - [`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` @@ -346,20 +362,20 @@ the wallet. message types, one per account, ordered by increasing account numbers. **Nested message:** `Account` - + - `uint32 account_number`: The BIP0044 account number. - + - `string account_name`: The name of the account. - + - `int64 total_balance`: The total (zero-conf and immature) balance, counted in Satoshis. - + - `uint32 external_key_count`: The number of derived keys in the external key chain. - + - `uint32 internal_key_count`: The number of derived keys in the internal key chain. - + - `uint32 imported_key_count`: The number of imported keys. - `bytes current_block_hash`: The hash of the block wallet is considered to diff --git a/rpc/documentation/clientusage.md b/rpc/documentation/clientusage.md index 3632311..ef96c76 100644 --- a/rpc/documentation/clientusage.md +++ b/rpc/documentation/clientusage.md @@ -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 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 by implementing a basic client that fetches the balance of the default account @@ -52,15 +52,15 @@ import ( "fmt" "path/filepath" - pb "github.com/btcsuite/btcwallet/rpc/walletrpc" + pb "github.com/lbryio/lbcwallet/rpc/walletrpc" "golang.org/x/net/context" "google.golang.org/grpc" "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() { 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`: ```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) \ - /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. @@ -145,7 +145,7 @@ auto read_file(std::string const& file_path) -> std::string { auto main() -> int { // 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 certificates (required by btcwallet). + // configured to use ECDSA TLS certificates (required by lbcwallet). setenv("GRPC_SSL_CIPHER_SUITES", "HIGH+ECDSA", 1); // 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) { throw NoHomeDirectoryException{}; } - return pw->pw_dir + "/.btcwallet/rpc.cert"s; + return pw->pw_dir + "/.lbcwallet/rpc.cert"s; }(); 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: ```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 ` - \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 @@ -245,10 +245,10 @@ namespace Example { // 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 - // certificates (required by btcwallet). + // certificates (required by lbcwallet). 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 cert = await FileUtils.ReadFileAsync(walletTlsCertFile); 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 and generates bindings for each service. Either copy the `.proto` to the client project directory, or reference the file from the -`btcwallet` project directory. +`lbcwallet` project directory. ```JavaScript // 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 certificates (required by btcwallet). +// configured to use ECDSA TLS certificates (required by lbcwallet). process.env['GRPC_SSL_CIPHER_SUITES'] = 'HIGH+ECDSA'; var fs = require('fs'); @@ -357,12 +357,12 @@ var grpc = require('grpc'); var protoDescriptor = grpc.load('./api.proto'); 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') { - certPath = path.join(process.env.LOCALAPPDATA, 'Btcwallet', 'rpc.cert'); + certPath = path.join(process.env.LOCALAPPDATA, 'lbcwallet', 'rpc.cert'); } else if (os.platform == 'darwin') { certPath = path.join(process.env.HOME, 'Library', 'Application Support', - 'Btcwallet', 'rpc.cert'); + 'lbcwallet', 'rpc.cert'); } var cert = fs.readFileSync(certPath); @@ -394,9 +394,9 @@ Full instructions for this procedure can be found Generate Python stubs from the `.proto`: ```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) \ - /path/to/btcwallet/rpc/api.proto + /path/to/lbcwallet/rpc/api.proto ``` Implement the client: @@ -413,15 +413,15 @@ timeout = 1 # seconds def main(): # 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 certificates (required by btcwallet). + # configured to use ECDSA TLS certificates (required by lbcwallet). 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': - 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': 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: cert = f.read() diff --git a/rpc/documentation/serverchanges.md b/rpc/documentation/serverchanges.md index 202ef55..e77e843 100644 --- a/rpc/documentation/serverchanges.md +++ b/rpc/documentation/serverchanges.md @@ -1,6 +1,6 @@ # 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 for the RPC implementation, changes to this API require extra dependencies and steps before changes to the server can be implemented. diff --git a/rpc/legacyrpc/errors.go b/rpc/legacyrpc/errors.go index 911bd7f..10b70d7 100644 --- a/rpc/legacyrpc/errors.go +++ b/rpc/legacyrpc/errors.go @@ -7,7 +7,7 @@ package legacyrpc import ( "errors" - "github.com/btcsuite/btcd/btcjson" + "github.com/lbryio/lbcd/btcjson" ) // TODO(jrick): There are several error paths which 'replace' various errors diff --git a/rpc/legacyrpc/methods.go b/rpc/legacyrpc/methods.go index 0ed1f34..00bb33c 100644 --- a/rpc/legacyrpc/methods.go +++ b/rpc/legacyrpc/methods.go @@ -15,19 +15,19 @@ import ( "sync" "time" - "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/rpcclient" - "github.com/btcsuite/btcd/txscript" - "github.com/btcsuite/btcd/wire" - "github.com/btcsuite/btcutil" - "github.com/btcsuite/btcwallet/chain" - "github.com/btcsuite/btcwallet/waddrmgr" - "github.com/btcsuite/btcwallet/wallet" - "github.com/btcsuite/btcwallet/wallet/txrules" - "github.com/btcsuite/btcwallet/wtxmgr" + "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/rpcclient" + "github.com/lbryio/lbcd/txscript" + "github.com/lbryio/lbcd/wire" + btcutil "github.com/lbryio/lbcutil" + "github.com/lbryio/lbcwallet/chain" + "github.com/lbryio/lbcwallet/waddrmgr" + "github.com/lbryio/lbcwallet/wallet" + "github.com/lbryio/lbcwallet/wallet/txrules" + "github.com/lbryio/lbcwallet/wtxmgr" ) const ( @@ -117,7 +117,7 @@ var rpcHandlers = map[string]struct { "importwallet": {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 "encryptwallet": {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 by btcwallet due to design differences. +// unsupported by lbcwallet due to design differences. func unsupported(interface{}, *wallet.Wallet) (interface{}, error) { return nil, &btcjson.RPCError{ 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 -// information about the current state of btcwallet. +// information about the current state of lbcwallet. // exist. 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. info, err := chainClient.GetInfo() if err != nil { @@ -546,7 +546,7 @@ func getAccount(icmd interface{}, w *wallet.Wallet) (interface{}, error) { // getAccountAddress handles a getaccountaddress by returning the most // 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 // next chained address in the keypool) is used. This can fail if the keypool // 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) { 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 // 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. // // Returns nil if chainClient is currently nil or there is an error // creating the client. // // 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 { if chainClient == nil { return nil @@ -1588,7 +1588,7 @@ func signRawTransaction(icmd interface{}, w *wallet.Wallet, chainClient *chain.R 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. inputs := make(map[wire.OutPoint][]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 - // 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 // the arguments. requested := make(map[wire.OutPoint]rpcclient.FutureGetTxOutResult) diff --git a/rpc/legacyrpc/rpchelp_test.go b/rpc/legacyrpc/rpchelp_test.go index 177ccb9..0ac102c 100644 --- a/rpc/legacyrpc/rpchelp_test.go +++ b/rpc/legacyrpc/rpchelp_test.go @@ -18,8 +18,8 @@ import ( "strings" "testing" - "github.com/btcsuite/btcd/btcjson" - "github.com/btcsuite/btcwallet/internal/rpchelp" + "github.com/lbryio/lbcd/btcjson" + "github.com/lbryio/lbcwallet/internal/rpchelp" ) func serverMethods() map[string]struct{} { diff --git a/rpc/legacyrpc/server.go b/rpc/legacyrpc/server.go index bc165dd..b3d9995 100644 --- a/rpc/legacyrpc/server.go +++ b/rpc/legacyrpc/server.go @@ -18,10 +18,10 @@ import ( "sync/atomic" "time" - "github.com/btcsuite/btcd/btcjson" - "github.com/btcsuite/btcwallet/chain" - "github.com/btcsuite/btcwallet/wallet" "github.com/btcsuite/websocket" + "github.com/lbryio/lbcd/btcjson" + "github.com/lbryio/lbcwallet/chain" + "github.com/lbryio/lbcwallet/wallet" ) type websocketClient struct { @@ -79,7 +79,7 @@ type Server struct { // jsonAuthFail sends a message back to the client if the http auth is rejected. 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) } @@ -263,8 +263,8 @@ func (s *Server) SetChainServer(chainClient chain.Interface) { } // handlerClosure creates a closure function for handling requests of the given -// method. This may be a request that is handled directly by btcwallet, or -// a chain server request that is handled by passing the request down to btcd. +// 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 . // // NOTE: These handlers do not handle special cases, such as the authenticate // method. Each of these must be checked beforehand (the method is already @@ -442,7 +442,7 @@ out: switch req.Method { case "stop": resp := makeResponse(req.ID, - "btcwallet stopping.", nil) + "lbcwallet stopping.", nil) mresp, err := json.Marshal(resp) // Expected to never fail. if err != nil { @@ -593,7 +593,7 @@ func (s *Server) postClientRPC(w http.ResponseWriter, r *http.Request) { return case "stop": stop = true - res = "btcwallet stopping" + res = "lbcwallet stopping" default: res, jsonErr = s.handlerClosure(&req)() } diff --git a/rpc/rpcserver/server.go b/rpc/rpcserver/server.go index 72a82a5..2cfa30b 100644 --- a/rpc/rpcserver/server.go +++ b/rpc/rpcserver/server.go @@ -8,11 +8,11 @@ // Full documentation of the API implemented by this package is maintained in a // 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: // -// https://github.com/btcsuite/btcwallet/blob/master/rpc/documentation/serverchanges.md +// https://github.com/lbryio/lbcwallet/blob/master/rpc/documentation/serverchanges.md package rpcserver import ( @@ -26,20 +26,20 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "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/btcutil/hdkeychain" - "github.com/btcsuite/btcwallet/chain" - "github.com/btcsuite/btcwallet/internal/cfgutil" - "github.com/btcsuite/btcwallet/internal/zero" - "github.com/btcsuite/btcwallet/netparams" - pb "github.com/btcsuite/btcwallet/rpc/walletrpc" - "github.com/btcsuite/btcwallet/waddrmgr" - "github.com/btcsuite/btcwallet/wallet" - "github.com/btcsuite/btcwallet/walletdb" + "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/lbcutil/hdkeychain" + "github.com/lbryio/lbcwallet/chain" + "github.com/lbryio/lbcwallet/internal/cfgutil" + "github.com/lbryio/lbcwallet/internal/zero" + "github.com/lbryio/lbcwallet/netparams" + pb "github.com/lbryio/lbcwallet/rpc/walletrpc" + "github.com/lbryio/lbcwallet/waddrmgr" + "github.com/lbryio/lbcwallet/wallet" + "github.com/lbryio/lbcwallet/walletdb" ) // Public API version constants @@ -109,7 +109,7 @@ type walletServer struct { } // 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 { loader *wallet.Loader activeNet *netparams.Params @@ -487,7 +487,7 @@ func (s *walletServer) SignTransaction(ctx context.Context, req *pb.SignTransact // BUGS: // - 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. // - 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 diff --git a/rpcserver.go b/rpcserver.go index 5169b39..7a29076 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -16,10 +16,10 @@ import ( "strings" "time" - "github.com/btcsuite/btcutil" - "github.com/btcsuite/btcwallet/rpc/legacyrpc" - "github.com/btcsuite/btcwallet/rpc/rpcserver" - "github.com/btcsuite/btcwallet/wallet" + btcutil "github.com/lbryio/lbcutil" + "github.com/lbryio/lbcwallet/rpc/legacyrpc" + "github.com/lbryio/lbcwallet/rpc/rpcserver" + "github.com/lbryio/lbcwallet/wallet" "google.golang.org/grpc" "google.golang.org/grpc/credentials" ) @@ -70,7 +70,7 @@ func generateRPCKeyPair(writeKey bool) (tls.Certificate, error) { } // Generate cert pair. - org := "btcwallet autogenerated cert" + org := "lbcwallet autogenerated cert" validUntil := time.Now().Add(time.Hour * 24 * 365 * 10) cert, key, err := btcutil.NewTLSCertPair(org, validUntil, nil) if err != nil { diff --git a/sample-btcwallet.conf b/sample-lbcwallet.conf similarity index 91% rename from sample-btcwallet.conf rename to sample-lbcwallet.conf index ad2757e..27f858b 100644 --- a/sample-btcwallet.conf +++ b/sample-lbcwallet.conf @@ -13,7 +13,7 @@ ; The directory to open and save wallet, transaction, and unspent transaction ; output files. Two directories, `mainnet` and `testnet` are used in this ; directory for mainnet and testnet wallets, respectively. -; appdata=~/.btcwallet +; appdata=~/.lbcwallet ; ------------------------------------------------------------------------------ @@ -27,11 +27,11 @@ ; proxyuser= ; proxypass= -; The server and port used for btcd websocket connections. +; The server and port used for websocket connections. ; rpcconnect=localhost:18334 -; File containing root certificates to authenticate a TLS connections with btcd -; cafile=~/.btcwallet/btcd.cert +; File containing root certificates to authenticate a TLS connections with +; cafile=~/.lbcwallet/.cert @@ -40,8 +40,8 @@ ; ------------------------------------------------------------------------------ ; TLS certificate and key file locations -; rpccert=~/.btcwallet/rpc.cert -; rpckey=~/.btcwallet/rpc.key +; rpccert=~/.lbcwallet/rpc.cert +; rpckey=~/.lbcwallet/rpc.key ; Enable one time TLS keys. This option results in the process generating ; a new certificate pair each startup, writing only the certificate file @@ -86,16 +86,16 @@ ; 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 ; username= ; 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 -; btcd RPC server. -; btcdusername= -; btcdpassword= +; RPC server. +; username= +; password= ; ------------------------------------------------------------------------------ @@ -106,7 +106,7 @@ ; Valid options are {trace, debug, info, warn, error, critical} ; debuglevel=info -; The port used to listen for HTTP profile requests. The profile server will +; The port used to listen for HTTP profile requests. The profile server will ; be disabled if this option is not specified. The profile information can be ; accessed at http://localhost:/debug/pprof once running. ; profile=6062 diff --git a/snacl/snacl.go b/snacl/snacl.go index fca7d28..208b058 100644 --- a/snacl/snacl.go +++ b/snacl/snacl.go @@ -13,7 +13,7 @@ import ( "io" "runtime/debug" - "github.com/btcsuite/btcwallet/internal/zero" + "github.com/lbryio/lbcwallet/internal/zero" "golang.org/x/crypto/nacl/secretbox" "golang.org/x/crypto/scrypt" ) diff --git a/waddrmgr/README.md b/waddrmgr/README.md index ae39edc..0c68574 100644 --- a/waddrmgr/README.md +++ b/waddrmgr/README.md @@ -1,8 +1,8 @@ waddrmgr ======== -[![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) Package waddrmgr provides a secure hierarchical deterministic wallet address manager. @@ -42,21 +42,21 @@ report. Package waddrmgr is licensed under the liberal ISC license. ## Documentation -[![GoDoc](https://godoc.org/github.com/btcsuite/btcwallet/waddrmgr?status.png)] -(http://godoc.org/github.com/btcsuite/btcwallet/waddrmgr) +[![GoDoc](https://godoc.org/github.com/lbryio/lbcwallet/waddrmgr?status.png)] +(http://godoc.org/github.com/lbryio/lbcwallet/waddrmgr) Full `go doc` style documentation for the project can be viewed online without 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 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 ```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 diff --git a/waddrmgr/address.go b/waddrmgr/address.go index d5beb93..5a32d2e 100644 --- a/waddrmgr/address.go +++ b/waddrmgr/address.go @@ -9,12 +9,12 @@ import ( "fmt" "sync" - "github.com/btcsuite/btcd/btcec" - "github.com/btcsuite/btcd/txscript" - "github.com/btcsuite/btcutil" - "github.com/btcsuite/btcutil/hdkeychain" - "github.com/btcsuite/btcwallet/internal/zero" - "github.com/btcsuite/btcwallet/walletdb" + "github.com/lbryio/lbcd/btcec" + "github.com/lbryio/lbcd/txscript" + btcutil "github.com/lbryio/lbcutil" + "github.com/lbryio/lbcutil/hdkeychain" + "github.com/lbryio/lbcwallet/internal/zero" + "github.com/lbryio/lbcwallet/walletdb" ) // AddressType represents the various address types waddrmgr is currently able diff --git a/waddrmgr/common_test.go b/waddrmgr/common_test.go index ceacf48..46ea496 100644 --- a/waddrmgr/common_test.go +++ b/waddrmgr/common_test.go @@ -12,10 +12,10 @@ import ( "testing" "time" - "github.com/btcsuite/btcd/chaincfg" - "github.com/btcsuite/btcutil/hdkeychain" - "github.com/btcsuite/btcwallet/walletdb" - _ "github.com/btcsuite/btcwallet/walletdb/bdb" + "github.com/lbryio/lbcd/chaincfg" + "github.com/lbryio/lbcutil/hdkeychain" + "github.com/lbryio/lbcwallet/walletdb" + _ "github.com/lbryio/lbcwallet/walletdb/bdb" ) var ( diff --git a/waddrmgr/db.go b/waddrmgr/db.go index 12612de..30f2e85 100644 --- a/waddrmgr/db.go +++ b/waddrmgr/db.go @@ -13,8 +13,8 @@ import ( "fmt" "time" - "github.com/btcsuite/btcd/chaincfg/chainhash" - "github.com/btcsuite/btcwallet/walletdb" + "github.com/lbryio/lbcd/chaincfg/chainhash" + "github.com/lbryio/lbcwallet/walletdb" ) const ( diff --git a/waddrmgr/db_test.go b/waddrmgr/db_test.go index c29cb85..0683860 100644 --- a/waddrmgr/db_test.go +++ b/waddrmgr/db_test.go @@ -5,8 +5,8 @@ import ( "fmt" "testing" - "github.com/btcsuite/btcd/chaincfg/chainhash" - "github.com/btcsuite/btcwallet/walletdb" + "github.com/lbryio/lbcd/chaincfg/chainhash" + "github.com/lbryio/lbcwallet/walletdb" ) // TestStoreMaxReorgDepth ensures that we can only store up to MaxReorgDepth diff --git a/waddrmgr/error.go b/waddrmgr/error.go index f836e2d..f360c55 100644 --- a/waddrmgr/error.go +++ b/waddrmgr/error.go @@ -8,7 +8,7 @@ import ( "fmt" "strconv" - "github.com/btcsuite/btcutil/hdkeychain" + "github.com/lbryio/lbcutil/hdkeychain" ) var ( diff --git a/waddrmgr/error_test.go b/waddrmgr/error_test.go index 398308b..8e0ed14 100644 --- a/waddrmgr/error_test.go +++ b/waddrmgr/error_test.go @@ -9,7 +9,7 @@ import ( "fmt" "testing" - "github.com/btcsuite/btcwallet/waddrmgr" + "github.com/lbryio/lbcwallet/waddrmgr" ) // TestErrorCodeStringer tests the stringized output for the ErrorCode type. diff --git a/waddrmgr/manager.go b/waddrmgr/manager.go index 570ef4f..25c2893 100644 --- a/waddrmgr/manager.go +++ b/waddrmgr/manager.go @@ -11,12 +11,12 @@ import ( "sync" "time" - "github.com/btcsuite/btcd/chaincfg" - "github.com/btcsuite/btcutil" - "github.com/btcsuite/btcutil/hdkeychain" - "github.com/btcsuite/btcwallet/internal/zero" - "github.com/btcsuite/btcwallet/snacl" - "github.com/btcsuite/btcwallet/walletdb" + "github.com/lbryio/lbcd/chaincfg" + btcutil "github.com/lbryio/lbcutil" + "github.com/lbryio/lbcutil/hdkeychain" + "github.com/lbryio/lbcwallet/internal/zero" + "github.com/lbryio/lbcwallet/snacl" + "github.com/lbryio/lbcwallet/walletdb" "github.com/lightninglabs/neutrino/cache/lru" ) diff --git a/waddrmgr/manager_test.go b/waddrmgr/manager_test.go index b0a5cf6..5ed8e65 100644 --- a/waddrmgr/manager_test.go +++ b/waddrmgr/manager_test.go @@ -15,14 +15,14 @@ import ( "testing" "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/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" ) diff --git a/waddrmgr/migrations.go b/waddrmgr/migrations.go index 5ed0072..460277e 100644 --- a/waddrmgr/migrations.go +++ b/waddrmgr/migrations.go @@ -5,9 +5,9 @@ import ( "fmt" "time" - "github.com/btcsuite/btcd/chaincfg" - "github.com/btcsuite/btcwallet/walletdb" - "github.com/btcsuite/btcwallet/walletdb/migration" + "github.com/lbryio/lbcd/chaincfg" + "github.com/lbryio/lbcwallet/walletdb" + "github.com/lbryio/lbcwallet/walletdb/migration" ) // versions is a list of the different database versions. The last entry should diff --git a/waddrmgr/migrations_test.go b/waddrmgr/migrations_test.go index c7aaeba..a29666c 100644 --- a/waddrmgr/migrations_test.go +++ b/waddrmgr/migrations_test.go @@ -8,9 +8,9 @@ import ( "testing" "time" - "github.com/btcsuite/btcd/chaincfg" - "github.com/btcsuite/btcd/chaincfg/chainhash" - "github.com/btcsuite/btcwallet/walletdb" + "github.com/lbryio/lbcd/chaincfg" + "github.com/lbryio/lbcd/chaincfg/chainhash" + "github.com/lbryio/lbcwallet/walletdb" ) // applyMigration is a helper function that allows us to assert the state of the diff --git a/waddrmgr/scoped_manager.go b/waddrmgr/scoped_manager.go index f408cb5..e3ba0c3 100644 --- a/waddrmgr/scoped_manager.go +++ b/waddrmgr/scoped_manager.go @@ -6,15 +6,15 @@ import ( "fmt" "sync" - "github.com/btcsuite/btcd/btcec" - "github.com/btcsuite/btcd/chaincfg" - "github.com/btcsuite/btcd/txscript" - "github.com/btcsuite/btcd/wire" - "github.com/btcsuite/btcutil" - "github.com/btcsuite/btcutil/hdkeychain" - "github.com/btcsuite/btcwallet/internal/zero" - "github.com/btcsuite/btcwallet/netparams" - "github.com/btcsuite/btcwallet/walletdb" + "github.com/lbryio/lbcd/btcec" + "github.com/lbryio/lbcd/chaincfg" + "github.com/lbryio/lbcd/txscript" + "github.com/lbryio/lbcd/wire" + btcutil "github.com/lbryio/lbcutil" + "github.com/lbryio/lbcutil/hdkeychain" + "github.com/lbryio/lbcwallet/internal/zero" + "github.com/lbryio/lbcwallet/netparams" + "github.com/lbryio/lbcwallet/walletdb" "github.com/lightninglabs/neutrino/cache/lru" ) diff --git a/waddrmgr/sync.go b/waddrmgr/sync.go index 3472ddb..7c1396e 100644 --- a/waddrmgr/sync.go +++ b/waddrmgr/sync.go @@ -7,8 +7,8 @@ package waddrmgr import ( "time" - "github.com/btcsuite/btcd/chaincfg/chainhash" - "github.com/btcsuite/btcwallet/walletdb" + "github.com/lbryio/lbcd/chaincfg/chainhash" + "github.com/lbryio/lbcwallet/walletdb" ) // BlockStamp defines a block (by height and a unique hash) and is used to mark diff --git a/waddrmgr/test_coverage.txt b/waddrmgr/test_coverage.txt index 3b08655..ef9c82b 100644 --- a/waddrmgr/test_coverage.txt +++ b/waddrmgr/test_coverage.txt @@ -1,126 +1,126 @@ -github.com/conformal/btcwallet/waddrmgr/db.go serializeBIP0044AccountRow 100.00% (19/19) -github.com/conformal/btcwallet/waddrmgr/manager.go Manager.lock 100.00% (12/12) -github.com/conformal/btcwallet/waddrmgr/db.go serializeScriptAddress 100.00% (10/10) -github.com/conformal/btcwallet/waddrmgr/db.go serializeImportedAddress 100.00% (10/10) -github.com/conformal/btcwallet/waddrmgr/db.go serializeAddressRow 100.00% (9/9) -github.com/conformal/btcwallet/waddrmgr/manager.go Manager.Address 100.00% (8/8) -github.com/conformal/btcwallet/waddrmgr/manager.go Manager.Lock 100.00% (8/8) -github.com/conformal/btcwallet/waddrmgr/address.go scriptAddress.Script 100.00% (7/7) -github.com/conformal/btcwallet/waddrmgr/db.go serializeAccountRow 100.00% (6/6) -github.com/conformal/btcwallet/waddrmgr/sync.go BlockIterator.Prev 100.00% (6/6) -github.com/conformal/btcwallet/waddrmgr/address.go zeroBigInt 100.00% (5/5) -github.com/conformal/btcwallet/waddrmgr/manager.go Manager.zeroSensitivePublicData 100.00% (5/5) -github.com/conformal/btcwallet/waddrmgr/address.go managedAddress.lock 100.00% (4/4) -github.com/conformal/btcwallet/waddrmgr/address.go scriptAddress.lock 100.00% (4/4) -github.com/conformal/btcwallet/waddrmgr/db.go serializeChainedAddress 100.00% (4/4) -github.com/conformal/btcwallet/waddrmgr/address.go managedAddress.ExportPrivKey 100.00% (4/4) -github.com/conformal/btcwallet/waddrmgr/manager.go fileExists 100.00% (4/4) -github.com/conformal/btcwallet/waddrmgr/error.go ManagerError.Error 100.00% (3/3) -github.com/conformal/btcwallet/waddrmgr/error.go ErrorCode.String 100.00% (3/3) -github.com/conformal/btcwallet/waddrmgr/address.go managedAddress.pubKeyBytes 100.00% (3/3) -github.com/conformal/btcwallet/waddrmgr/sync.go Manager.NewIterateRecentBlocks 100.00% (3/3) -github.com/conformal/btcwallet/waddrmgr/sync.go BlockIterator.BlockStamp 100.00% (3/3) -github.com/conformal/btcwallet/waddrmgr/db.go accountKey 100.00% (3/3) -github.com/conformal/btcwallet/waddrmgr/sync.go Manager.SyncedTo 100.00% (3/3) -github.com/conformal/btcwallet/waddrmgr/db.go managerTx.PutAccountInfo 100.00% (3/3) -github.com/conformal/btcwallet/waddrmgr/manager.go Manager.IsLocked 100.00% (3/3) -github.com/conformal/btcwallet/waddrmgr/db.go managerTx.PutImportedAddress 100.00% (3/3) -github.com/conformal/btcwallet/waddrmgr/db.go managerTx.ExistsAddress 100.00% (3/3) -github.com/conformal/btcwallet/waddrmgr/address.go zero 100.00% (2/2) -github.com/conformal/btcwallet/waddrmgr/address.go scriptAddress.Account 100.00% (1/1) -github.com/conformal/btcwallet/waddrmgr/address.go scriptAddress.Compressed 100.00% (1/1) -github.com/conformal/btcwallet/waddrmgr/sync.go newSyncState 100.00% (1/1) -github.com/conformal/btcwallet/waddrmgr/address.go scriptAddress.Internal 100.00% (1/1) -github.com/conformal/btcwallet/waddrmgr/manager.go cryptoKey.CopyBytes 100.00% (1/1) -github.com/conformal/btcwallet/waddrmgr/manager.go newManager 100.00% (1/1) -github.com/conformal/btcwallet/waddrmgr/address.go managedAddress.AddrHash 100.00% (1/1) -github.com/conformal/btcwallet/waddrmgr/manager.go defaultNewSecretKey 100.00% (1/1) -github.com/conformal/btcwallet/waddrmgr/address.go scriptAddress.Imported 100.00% (1/1) -github.com/conformal/btcwallet/waddrmgr/address.go scriptAddress.AddrHash 100.00% (1/1) -github.com/conformal/btcwallet/waddrmgr/address.go scriptAddress.Address 100.00% (1/1) -github.com/conformal/btcwallet/waddrmgr/address.go managedAddress.Account 100.00% (1/1) -github.com/conformal/btcwallet/waddrmgr/address.go managedAddress.Internal 100.00% (1/1) -github.com/conformal/btcwallet/waddrmgr/manager.go Manager.Net 100.00% (1/1) -github.com/conformal/btcwallet/waddrmgr/address.go managedAddress.ExportPubKey 100.00% (1/1) -github.com/conformal/btcwallet/waddrmgr/error.go managerError 100.00% (1/1) -github.com/conformal/btcwallet/waddrmgr/address.go managedAddress.PubKey 100.00% (1/1) -github.com/conformal/btcwallet/waddrmgr/manager.go cryptoKey.Bytes 100.00% (1/1) -github.com/conformal/btcwallet/waddrmgr/address.go managedAddress.Compressed 100.00% (1/1) -github.com/conformal/btcwallet/waddrmgr/address.go managedAddress.Address 100.00% (1/1) -github.com/conformal/btcwallet/waddrmgr/address.go managedAddress.Imported 100.00% (1/1) -github.com/conformal/btcwallet/waddrmgr/sync.go Manager.SetSyncedTo 93.94% (31/33) -github.com/conformal/btcwallet/waddrmgr/address.go managedAddress.PrivKey 91.67% (11/12) -github.com/conformal/btcwallet/waddrmgr/db.go deserializeBIP0044AccountRow 90.48% (19/21) -github.com/conformal/btcwallet/waddrmgr/manager.go Manager.keyToManaged 90.00% (9/10) -github.com/conformal/btcwallet/waddrmgr/db.go managerTx.FetchCryptoKeys 88.89% (16/18) -github.com/conformal/btcwallet/waddrmgr/manager.go Manager.Close 88.89% (8/9) -github.com/conformal/btcwallet/waddrmgr/address.go newManagedAddressWithoutPrivKey 87.50% (7/8) -github.com/conformal/btcwallet/waddrmgr/db.go managerTx.PutRecentBlocks 85.71% (12/14) -github.com/conformal/btcwallet/waddrmgr/manager.go Open 85.71% (6/7) -github.com/conformal/btcwallet/waddrmgr/db.go deserializeScriptAddress 84.62% (11/13) -github.com/conformal/btcwallet/waddrmgr/db.go deserializeImportedAddress 84.62% (11/13) -github.com/conformal/btcwallet/waddrmgr/db.go managerTx.FetchRecentBlocks 84.62% (11/13) -github.com/conformal/btcwallet/waddrmgr/db.go managerTx.FetchMasterKeyParams 84.62% (11/13) -github.com/conformal/btcwallet/waddrmgr/db.go deserializeAddressRow 83.33% (10/12) -github.com/conformal/btcwallet/waddrmgr/manager.go Manager.loadAndCacheAddress 83.33% (10/12) -github.com/conformal/btcwallet/waddrmgr/address.go managedAddress.unlock 81.82% (9/11) -github.com/conformal/btcwallet/waddrmgr/address.go scriptAddress.unlock 81.82% (9/11) -github.com/conformal/btcwallet/waddrmgr/manager.go Manager.nextAddresses 80.00% (52/65) -github.com/conformal/btcwallet/waddrmgr/db.go managerTx.PutScriptAddress 80.00% (4/5) -github.com/conformal/btcwallet/waddrmgr/manager.go Manager.ChangePassphrase 79.10% (53/67) -github.com/conformal/btcwallet/waddrmgr/db.go managerTx.PutChainedAddress 78.26% (18/23) -github.com/conformal/btcwallet/waddrmgr/db.go managerTx.FetchSyncedTo 77.78% (7/9) -github.com/conformal/btcwallet/waddrmgr/db.go managerTx.PutStartBlock 77.78% (7/9) -github.com/conformal/btcwallet/waddrmgr/db.go managerTx.FetchStartBlock 77.78% (7/9) -github.com/conformal/btcwallet/waddrmgr/db.go managerTx.PutSyncedTo 77.78% (7/9) -github.com/conformal/btcwallet/waddrmgr/manager.go Manager.existsAddress 77.78% (7/9) -github.com/conformal/btcwallet/waddrmgr/db.go deserializeAccountRow 77.78% (7/9) -github.com/conformal/btcwallet/waddrmgr/manager.go Manager.ExportWatchingOnly 75.00% (12/16) -github.com/conformal/btcwallet/waddrmgr/address.go newManagedAddressFromExtKey 75.00% (12/16) -github.com/conformal/btcwallet/waddrmgr/address.go newManagedAddress 75.00% (9/12) -github.com/conformal/btcwallet/waddrmgr/db.go managerTx.PutWatchingOnly 75.00% (6/8) -github.com/conformal/btcwallet/waddrmgr/db.go managerTx.PutNumAccounts 75.00% (6/8) -github.com/conformal/btcwallet/waddrmgr/address.go newScriptAddress 75.00% (3/4) -github.com/conformal/btcwallet/waddrmgr/manager.go defaultNewCryptoKey 75.00% (3/4) -github.com/conformal/btcwallet/waddrmgr/manager.go Manager.chainAddressRowToManaged 75.00% (3/4) -github.com/conformal/btcwallet/waddrmgr/manager.go checkBranchKeys 75.00% (3/4) -github.com/conformal/btcwallet/waddrmgr/manager.go Manager.deriveKeyFromPath 75.00% (3/4) -github.com/conformal/btcwallet/waddrmgr/manager.go loadManager 72.55% (37/51) -github.com/conformal/btcwallet/waddrmgr/db.go managerTx.putAddress 71.43% (5/7) -github.com/conformal/btcwallet/waddrmgr/db.go deserializeChainedAddress 71.43% (5/7) -github.com/conformal/btcwallet/waddrmgr/manager.go Manager.deriveKey 69.23% (9/13) -github.com/conformal/btcwallet/waddrmgr/manager.go Manager.ImportScript 67.44% (29/43) -github.com/conformal/btcwallet/waddrmgr/manager.go Manager.Unlock 67.35% (33/49) -github.com/conformal/btcwallet/waddrmgr/db.go managerTx.FetchAddress 66.67% (10/15) -github.com/conformal/btcwallet/waddrmgr/manager.go Manager.importedAddressRowToManaged 66.67% (10/15) -github.com/conformal/btcwallet/waddrmgr/db.go managerTx.PutMasterKeyParams 66.67% (8/12) -github.com/conformal/btcwallet/waddrmgr/manager.go Manager.LastInternalAddress 66.67% (6/9) -github.com/conformal/btcwallet/waddrmgr/manager.go Manager.LastExternalAddress 66.67% (6/9) -github.com/conformal/btcwallet/waddrmgr/db.go managerTx.putAccountRow 66.67% (4/6) -github.com/conformal/btcwallet/waddrmgr/manager.go Manager.rowInterfaceToManaged 66.67% (4/6) -github.com/conformal/btcwallet/waddrmgr/manager.go Manager.NextExternalAddresses 66.67% (4/6) -github.com/conformal/btcwallet/waddrmgr/manager.go Manager.NextInternalAddresses 66.67% (4/6) -github.com/conformal/btcwallet/waddrmgr/db.go managerTx.FetchWatchingOnly 66.67% (4/6) -github.com/conformal/btcwallet/waddrmgr/sync.go syncState.iter 66.67% (2/3) -github.com/conformal/btcwallet/waddrmgr/db.go managerTx.DeletePrivateKeys 66.04% (35/53) -github.com/conformal/btcwallet/waddrmgr/db.go openOrCreateDB 66.04% (35/53) -github.com/conformal/btcwallet/waddrmgr/manager.go Manager.ImportPrivateKey 64.71% (33/51) -github.com/conformal/btcwallet/waddrmgr/db.go managerTx.PutCryptoKeys 64.71% (11/17) -github.com/conformal/btcwallet/waddrmgr/manager.go Manager.loadAccountInfo 62.96% (34/54) -github.com/conformal/btcwallet/waddrmgr/db.go managerTx.FetchAccountInfo 61.54% (8/13) -github.com/conformal/btcwallet/waddrmgr/manager.go Manager.scriptAddressRowToManaged 60.00% (3/5) -github.com/conformal/btcwallet/waddrmgr/manager.go Create 58.59% (58/99) -github.com/conformal/btcwallet/waddrmgr/manager.go deriveAccountKey 53.85% (7/13) -github.com/conformal/btcwallet/waddrmgr/db.go managerDB.Update 50.00% (4/8) -github.com/conformal/btcwallet/waddrmgr/db.go managerDB.View 50.00% (4/8) -github.com/conformal/btcwallet/waddrmgr/db.go managerDB.Close 50.00% (2/4) -github.com/conformal/btcwallet/waddrmgr/db.go managerDB.CopyDB 45.45% (5/11) -github.com/conformal/btcwallet/waddrmgr/db.go managerTx.FetchAllAddresses 0.00% (0/20) -github.com/conformal/btcwallet/waddrmgr/manager.go Manager.AllActiveAddresses 0.00% (0/16) -github.com/conformal/btcwallet/waddrmgr/db.go managerDB.WriteTo 0.00% (0/11) -github.com/conformal/btcwallet/waddrmgr/sync.go BlockIterator.Next 0.00% (0/6) -github.com/conformal/btcwallet/waddrmgr/db.go managerTx.FetchNumAccounts 0.00% (0/6) -github.com/conformal/btcwallet/waddrmgr/manager.go Manager.Export 0.00% (0/3) -github.com/conformal/btcwallet/waddrmgr ----------------------------------- 72.59% (1030/1419) +github.com/lbryio/lbcwallet/waddrmgr/db.go serializeBIP0044AccountRow 100.00% (19/19) +github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.lock 100.00% (12/12) +github.com/lbryio/lbcwallet/waddrmgr/db.go serializeScriptAddress 100.00% (10/10) +github.com/lbryio/lbcwallet/waddrmgr/db.go serializeImportedAddress 100.00% (10/10) +github.com/lbryio/lbcwallet/waddrmgr/db.go serializeAddressRow 100.00% (9/9) +github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.Address 100.00% (8/8) +github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.Lock 100.00% (8/8) +github.com/lbryio/lbcwallet/waddrmgr/address.go scriptAddress.Script 100.00% (7/7) +github.com/lbryio/lbcwallet/waddrmgr/db.go serializeAccountRow 100.00% (6/6) +github.com/lbryio/lbcwallet/waddrmgr/sync.go BlockIterator.Prev 100.00% (6/6) +github.com/lbryio/lbcwallet/waddrmgr/address.go zeroBigInt 100.00% (5/5) +github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.zeroSensitivePublicData 100.00% (5/5) +github.com/lbryio/lbcwallet/waddrmgr/address.go managedAddress.lock 100.00% (4/4) +github.com/lbryio/lbcwallet/waddrmgr/address.go scriptAddress.lock 100.00% (4/4) +github.com/lbryio/lbcwallet/waddrmgr/db.go serializeChainedAddress 100.00% (4/4) +github.com/lbryio/lbcwallet/waddrmgr/address.go managedAddress.ExportPrivKey 100.00% (4/4) +github.com/lbryio/lbcwallet/waddrmgr/manager.go fileExists 100.00% (4/4) +github.com/lbryio/lbcwallet/waddrmgr/error.go ManagerError.Error 100.00% (3/3) +github.com/lbryio/lbcwallet/waddrmgr/error.go ErrorCode.String 100.00% (3/3) +github.com/lbryio/lbcwallet/waddrmgr/address.go managedAddress.pubKeyBytes 100.00% (3/3) +github.com/lbryio/lbcwallet/waddrmgr/sync.go Manager.NewIterateRecentBlocks 100.00% (3/3) +github.com/lbryio/lbcwallet/waddrmgr/sync.go BlockIterator.BlockStamp 100.00% (3/3) +github.com/lbryio/lbcwallet/waddrmgr/db.go accountKey 100.00% (3/3) +github.com/lbryio/lbcwallet/waddrmgr/sync.go Manager.SyncedTo 100.00% (3/3) +github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.PutAccountInfo 100.00% (3/3) +github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.IsLocked 100.00% (3/3) +github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.PutImportedAddress 100.00% (3/3) +github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.ExistsAddress 100.00% (3/3) +github.com/lbryio/lbcwallet/waddrmgr/address.go zero 100.00% (2/2) +github.com/lbryio/lbcwallet/waddrmgr/address.go scriptAddress.Account 100.00% (1/1) +github.com/lbryio/lbcwallet/waddrmgr/address.go scriptAddress.Compressed 100.00% (1/1) +github.com/lbryio/lbcwallet/waddrmgr/sync.go newSyncState 100.00% (1/1) +github.com/lbryio/lbcwallet/waddrmgr/address.go scriptAddress.Internal 100.00% (1/1) +github.com/lbryio/lbcwallet/waddrmgr/manager.go cryptoKey.CopyBytes 100.00% (1/1) +github.com/lbryio/lbcwallet/waddrmgr/manager.go newManager 100.00% (1/1) +github.com/lbryio/lbcwallet/waddrmgr/address.go managedAddress.AddrHash 100.00% (1/1) +github.com/lbryio/lbcwallet/waddrmgr/manager.go defaultNewSecretKey 100.00% (1/1) +github.com/lbryio/lbcwallet/waddrmgr/address.go scriptAddress.Imported 100.00% (1/1) +github.com/lbryio/lbcwallet/waddrmgr/address.go scriptAddress.AddrHash 100.00% (1/1) +github.com/lbryio/lbcwallet/waddrmgr/address.go scriptAddress.Address 100.00% (1/1) +github.com/lbryio/lbcwallet/waddrmgr/address.go managedAddress.Account 100.00% (1/1) +github.com/lbryio/lbcwallet/waddrmgr/address.go managedAddress.Internal 100.00% (1/1) +github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.Net 100.00% (1/1) +github.com/lbryio/lbcwallet/waddrmgr/address.go managedAddress.ExportPubKey 100.00% (1/1) +github.com/lbryio/lbcwallet/waddrmgr/error.go managerError 100.00% (1/1) +github.com/lbryio/lbcwallet/waddrmgr/address.go managedAddress.PubKey 100.00% (1/1) +github.com/lbryio/lbcwallet/waddrmgr/manager.go cryptoKey.Bytes 100.00% (1/1) +github.com/lbryio/lbcwallet/waddrmgr/address.go managedAddress.Compressed 100.00% (1/1) +github.com/lbryio/lbcwallet/waddrmgr/address.go managedAddress.Address 100.00% (1/1) +github.com/lbryio/lbcwallet/waddrmgr/address.go managedAddress.Imported 100.00% (1/1) +github.com/lbryio/lbcwallet/waddrmgr/sync.go Manager.SetSyncedTo 93.94% (31/33) +github.com/lbryio/lbcwallet/waddrmgr/address.go managedAddress.PrivKey 91.67% (11/12) +github.com/lbryio/lbcwallet/waddrmgr/db.go deserializeBIP0044AccountRow 90.48% (19/21) +github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.keyToManaged 90.00% (9/10) +github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.FetchCryptoKeys 88.89% (16/18) +github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.Close 88.89% (8/9) +github.com/lbryio/lbcwallet/waddrmgr/address.go newManagedAddressWithoutPrivKey 87.50% (7/8) +github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.PutRecentBlocks 85.71% (12/14) +github.com/lbryio/lbcwallet/waddrmgr/manager.go Open 85.71% (6/7) +github.com/lbryio/lbcwallet/waddrmgr/db.go deserializeScriptAddress 84.62% (11/13) +github.com/lbryio/lbcwallet/waddrmgr/db.go deserializeImportedAddress 84.62% (11/13) +github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.FetchRecentBlocks 84.62% (11/13) +github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.FetchMasterKeyParams 84.62% (11/13) +github.com/lbryio/lbcwallet/waddrmgr/db.go deserializeAddressRow 83.33% (10/12) +github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.loadAndCacheAddress 83.33% (10/12) +github.com/lbryio/lbcwallet/waddrmgr/address.go managedAddress.unlock 81.82% (9/11) +github.com/lbryio/lbcwallet/waddrmgr/address.go scriptAddress.unlock 81.82% (9/11) +github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.nextAddresses 80.00% (52/65) +github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.PutScriptAddress 80.00% (4/5) +github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.ChangePassphrase 79.10% (53/67) +github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.PutChainedAddress 78.26% (18/23) +github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.FetchSyncedTo 77.78% (7/9) +github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.PutStartBlock 77.78% (7/9) +github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.FetchStartBlock 77.78% (7/9) +github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.PutSyncedTo 77.78% (7/9) +github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.existsAddress 77.78% (7/9) +github.com/lbryio/lbcwallet/waddrmgr/db.go deserializeAccountRow 77.78% (7/9) +github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.ExportWatchingOnly 75.00% (12/16) +github.com/lbryio/lbcwallet/waddrmgr/address.go newManagedAddressFromExtKey 75.00% (12/16) +github.com/lbryio/lbcwallet/waddrmgr/address.go newManagedAddress 75.00% (9/12) +github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.PutWatchingOnly 75.00% (6/8) +github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.PutNumAccounts 75.00% (6/8) +github.com/lbryio/lbcwallet/waddrmgr/address.go newScriptAddress 75.00% (3/4) +github.com/lbryio/lbcwallet/waddrmgr/manager.go defaultNewCryptoKey 75.00% (3/4) +github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.chainAddressRowToManaged 75.00% (3/4) +github.com/lbryio/lbcwallet/waddrmgr/manager.go checkBranchKeys 75.00% (3/4) +github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.deriveKeyFromPath 75.00% (3/4) +github.com/lbryio/lbcwallet/waddrmgr/manager.go loadManager 72.55% (37/51) +github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.putAddress 71.43% (5/7) +github.com/lbryio/lbcwallet/waddrmgr/db.go deserializeChainedAddress 71.43% (5/7) +github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.deriveKey 69.23% (9/13) +github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.ImportScript 67.44% (29/43) +github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.Unlock 67.35% (33/49) +github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.FetchAddress 66.67% (10/15) +github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.importedAddressRowToManaged 66.67% (10/15) +github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.PutMasterKeyParams 66.67% (8/12) +github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.LastInternalAddress 66.67% (6/9) +github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.LastExternalAddress 66.67% (6/9) +github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.putAccountRow 66.67% (4/6) +github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.rowInterfaceToManaged 66.67% (4/6) +github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.NextExternalAddresses 66.67% (4/6) +github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.NextInternalAddresses 66.67% (4/6) +github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.FetchWatchingOnly 66.67% (4/6) +github.com/lbryio/lbcwallet/waddrmgr/sync.go syncState.iter 66.67% (2/3) +github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.DeletePrivateKeys 66.04% (35/53) +github.com/lbryio/lbcwallet/waddrmgr/db.go openOrCreateDB 66.04% (35/53) +github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.ImportPrivateKey 64.71% (33/51) +github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.PutCryptoKeys 64.71% (11/17) +github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.loadAccountInfo 62.96% (34/54) +github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.FetchAccountInfo 61.54% (8/13) +github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.scriptAddressRowToManaged 60.00% (3/5) +github.com/lbryio/lbcwallet/waddrmgr/manager.go Create 58.59% (58/99) +github.com/lbryio/lbcwallet/waddrmgr/manager.go deriveAccountKey 53.85% (7/13) +github.com/lbryio/lbcwallet/waddrmgr/db.go managerDB.Update 50.00% (4/8) +github.com/lbryio/lbcwallet/waddrmgr/db.go managerDB.View 50.00% (4/8) +github.com/lbryio/lbcwallet/waddrmgr/db.go managerDB.Close 50.00% (2/4) +github.com/lbryio/lbcwallet/waddrmgr/db.go managerDB.CopyDB 45.45% (5/11) +github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.FetchAllAddresses 0.00% (0/20) +github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.AllActiveAddresses 0.00% (0/16) +github.com/lbryio/lbcwallet/waddrmgr/db.go managerDB.WriteTo 0.00% (0/11) +github.com/lbryio/lbcwallet/waddrmgr/sync.go BlockIterator.Next 0.00% (0/6) +github.com/lbryio/lbcwallet/waddrmgr/db.go managerTx.FetchNumAccounts 0.00% (0/6) +github.com/lbryio/lbcwallet/waddrmgr/manager.go Manager.Export 0.00% (0/3) +github.com/lbryio/lbcwallet/waddrmgr ----------------------------------- 72.59% (1030/1419) diff --git a/wallet/README.md b/wallet/README.md index 196920c..9047a48 100644 --- a/wallet/README.md +++ b/wallet/README.md @@ -1,8 +1,8 @@ wallet ====== -[![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) ## Feature Overview @@ -10,21 +10,21 @@ TODO: Flesh out this section ## Documentation -[![GoDoc](https://godoc.org/github.com/btcsuite/btcwallet/wallet?status.png)] -(http://godoc.org/github.com/btcsuite/btcwallet/wallet) +[![GoDoc](https://godoc.org/github.com/lbryio/lbcwallet/wallet?status.png)] +(http://godoc.org/github.com/lbryio/lbcwallet/wallet) Full `go doc` style documentation for the project can be viewed online without 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 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 ```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 diff --git a/wallet/chainntfns.go b/wallet/chainntfns.go index 4182ad2..edad9e9 100644 --- a/wallet/chainntfns.go +++ b/wallet/chainntfns.go @@ -9,13 +9,13 @@ import ( "fmt" "time" - "github.com/btcsuite/btcd/chaincfg/chainhash" - "github.com/btcsuite/btcd/txscript" - "github.com/btcsuite/btcd/wire" - "github.com/btcsuite/btcwallet/chain" - "github.com/btcsuite/btcwallet/waddrmgr" - "github.com/btcsuite/btcwallet/walletdb" - "github.com/btcsuite/btcwallet/wtxmgr" + "github.com/lbryio/lbcd/chaincfg/chainhash" + "github.com/lbryio/lbcd/txscript" + "github.com/lbryio/lbcd/wire" + "github.com/lbryio/lbcwallet/chain" + "github.com/lbryio/lbcwallet/waddrmgr" + "github.com/lbryio/lbcwallet/walletdb" + "github.com/lbryio/lbcwallet/wtxmgr" ) const ( @@ -39,7 +39,7 @@ func (w *Wallet) handleChainNotifications() { // TODO(aakselrod): There's a race condition here, which // happens when a reorg occurs between the // 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 // the way Neutrino does, and get rid of the loop. The // other alternative is to check the final hash and, diff --git a/wallet/chainntfns_test.go b/wallet/chainntfns_test.go index 8d62390..98f5015 100644 --- a/wallet/chainntfns_test.go +++ b/wallet/chainntfns_test.go @@ -6,11 +6,11 @@ import ( "testing" "time" - "github.com/btcsuite/btcd/chaincfg" - "github.com/btcsuite/btcd/chaincfg/chainhash" - "github.com/btcsuite/btcd/wire" - "github.com/btcsuite/btcwallet/waddrmgr" - _ "github.com/btcsuite/btcwallet/walletdb/bdb" + "github.com/lbryio/lbcd/chaincfg" + "github.com/lbryio/lbcd/chaincfg/chainhash" + "github.com/lbryio/lbcd/wire" + "github.com/lbryio/lbcwallet/waddrmgr" + _ "github.com/lbryio/lbcwallet/walletdb/bdb" ) const ( diff --git a/wallet/common.go b/wallet/common.go index 15a0296..4e86a5f 100644 --- a/wallet/common.go +++ b/wallet/common.go @@ -8,9 +8,9 @@ package wallet import ( "time" - "github.com/btcsuite/btcd/chaincfg/chainhash" - "github.com/btcsuite/btcd/wire" - "github.com/btcsuite/btcutil" + "github.com/lbryio/lbcd/chaincfg/chainhash" + "github.com/lbryio/lbcd/wire" + btcutil "github.com/lbryio/lbcutil" ) // Note: The following common types should never reference the Wallet type. diff --git a/wallet/createtx.go b/wallet/createtx.go index c7fcc70..2b16674 100644 --- a/wallet/createtx.go +++ b/wallet/createtx.go @@ -10,15 +10,15 @@ import ( "math/rand" "sort" - "github.com/btcsuite/btcd/btcec" - "github.com/btcsuite/btcd/txscript" - "github.com/btcsuite/btcd/wire" - "github.com/btcsuite/btcutil" - "github.com/btcsuite/btcwallet/waddrmgr" - "github.com/btcsuite/btcwallet/wallet/txauthor" - "github.com/btcsuite/btcwallet/wallet/txsizes" - "github.com/btcsuite/btcwallet/walletdb" - "github.com/btcsuite/btcwallet/wtxmgr" + "github.com/lbryio/lbcd/btcec" + "github.com/lbryio/lbcd/txscript" + "github.com/lbryio/lbcd/wire" + btcutil "github.com/lbryio/lbcutil" + "github.com/lbryio/lbcwallet/waddrmgr" + "github.com/lbryio/lbcwallet/wallet/txauthor" + "github.com/lbryio/lbcwallet/wallet/txsizes" + "github.com/lbryio/lbcwallet/walletdb" + "github.com/lbryio/lbcwallet/wtxmgr" ) // byAmount defines the methods needed to satisify sort.Interface to diff --git a/wallet/createtx_test.go b/wallet/createtx_test.go index cdbecb3..155d019 100644 --- a/wallet/createtx_test.go +++ b/wallet/createtx_test.go @@ -9,16 +9,16 @@ import ( "testing" "time" - "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/btcwallet/waddrmgr" - "github.com/btcsuite/btcwallet/wallet/txauthor" - "github.com/btcsuite/btcwallet/walletdb" - _ "github.com/btcsuite/btcwallet/walletdb/bdb" - "github.com/btcsuite/btcwallet/wtxmgr" + "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/lbcwallet/waddrmgr" + "github.com/lbryio/lbcwallet/wallet/txauthor" + "github.com/lbryio/lbcwallet/walletdb" + _ "github.com/lbryio/lbcwallet/walletdb/bdb" + "github.com/lbryio/lbcwallet/wtxmgr" "github.com/stretchr/testify/require" ) diff --git a/wallet/example_test.go b/wallet/example_test.go index 2a9f30c..b1e77ad 100644 --- a/wallet/example_test.go +++ b/wallet/example_test.go @@ -6,10 +6,10 @@ import ( "testing" "time" - "github.com/btcsuite/btcd/chaincfg" - "github.com/btcsuite/btcutil/hdkeychain" - "github.com/btcsuite/btcwallet/waddrmgr" - "github.com/btcsuite/btcwallet/walletdb" + "github.com/lbryio/lbcd/chaincfg" + "github.com/lbryio/lbcutil/hdkeychain" + "github.com/lbryio/lbcwallet/waddrmgr" + "github.com/lbryio/lbcwallet/walletdb" ) // defaultDBTimeout specifies the timeout value when opening the wallet diff --git a/wallet/history.go b/wallet/history.go index a33e0e1..9797bb0 100644 --- a/wallet/history.go +++ b/wallet/history.go @@ -7,10 +7,10 @@ package wallet import ( "fmt" - "github.com/btcsuite/btcd/chaincfg/chainhash" - "github.com/btcsuite/btcwallet/waddrmgr" - "github.com/btcsuite/btcwallet/walletdb" - "github.com/btcsuite/btcwallet/wtxmgr" + "github.com/lbryio/lbcd/chaincfg/chainhash" + "github.com/lbryio/lbcwallet/waddrmgr" + "github.com/lbryio/lbcwallet/walletdb" + "github.com/lbryio/lbcwallet/wtxmgr" ) var ( @@ -25,7 +25,7 @@ var ( // a full chain rescan of all wallet transaction and UTXO data. User-defined // transaction labels can optionally be kept by setting keepLabels to true. 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 { // If we want to keep our tx labels, we read them out so we diff --git a/wallet/import.go b/wallet/import.go index 4528875..5546d52 100644 --- a/wallet/import.go +++ b/wallet/import.go @@ -5,13 +5,13 @@ import ( "errors" "fmt" - "github.com/btcsuite/btcd/btcec" - "github.com/btcsuite/btcd/wire" - "github.com/btcsuite/btcutil" - "github.com/btcsuite/btcutil/hdkeychain" - "github.com/btcsuite/btcwallet/netparams" - "github.com/btcsuite/btcwallet/waddrmgr" - "github.com/btcsuite/btcwallet/walletdb" + "github.com/lbryio/lbcd/btcec" + "github.com/lbryio/lbcd/wire" + btcutil "github.com/lbryio/lbcutil" + "github.com/lbryio/lbcutil/hdkeychain" + "github.com/lbryio/lbcwallet/netparams" + "github.com/lbryio/lbcwallet/waddrmgr" + "github.com/lbryio/lbcwallet/walletdb" ) const ( diff --git a/wallet/import_test.go b/wallet/import_test.go index a0f6503..562ede8 100644 --- a/wallet/import_test.go +++ b/wallet/import_test.go @@ -5,11 +5,11 @@ import ( "strings" "testing" - "github.com/btcsuite/btcd/chaincfg" - "github.com/btcsuite/btcd/txscript" - "github.com/btcsuite/btcutil" - "github.com/btcsuite/btcutil/hdkeychain" - "github.com/btcsuite/btcwallet/waddrmgr" + "github.com/lbryio/lbcd/chaincfg" + "github.com/lbryio/lbcd/txscript" + btcutil "github.com/lbryio/lbcutil" + "github.com/lbryio/lbcutil/hdkeychain" + "github.com/lbryio/lbcwallet/waddrmgr" "github.com/stretchr/testify/require" ) diff --git a/wallet/loader.go b/wallet/loader.go index 3545b4b..e52d0a1 100644 --- a/wallet/loader.go +++ b/wallet/loader.go @@ -12,11 +12,11 @@ import ( "sync" "time" - "github.com/btcsuite/btcd/chaincfg" - "github.com/btcsuite/btcutil/hdkeychain" - "github.com/btcsuite/btcwallet/internal/prompt" - "github.com/btcsuite/btcwallet/waddrmgr" - "github.com/btcsuite/btcwallet/walletdb" + "github.com/lbryio/lbcd/chaincfg" + "github.com/lbryio/lbcutil/hdkeychain" + "github.com/lbryio/lbcwallet/internal/prompt" + "github.com/lbryio/lbcwallet/waddrmgr" + "github.com/lbryio/lbcwallet/walletdb" ) const ( diff --git a/wallet/log.go b/wallet/log.go index de39fe1..a9bddaf 100644 --- a/wallet/log.go +++ b/wallet/log.go @@ -6,9 +6,9 @@ package wallet import ( "github.com/btcsuite/btclog" - "github.com/btcsuite/btcwallet/waddrmgr" - "github.com/btcsuite/btcwallet/walletdb/migration" - "github.com/btcsuite/btcwallet/wtxmgr" + "github.com/lbryio/lbcwallet/waddrmgr" + "github.com/lbryio/lbcwallet/walletdb/migration" + "github.com/lbryio/lbcwallet/wtxmgr" ) // log is a logger that is initialized with no output filters. This diff --git a/wallet/mock.go b/wallet/mock.go index 09b5e65..c9d36bc 100644 --- a/wallet/mock.go +++ b/wallet/mock.go @@ -3,11 +3,11 @@ package wallet import ( "time" - "github.com/btcsuite/btcd/chaincfg/chainhash" - "github.com/btcsuite/btcd/wire" - "github.com/btcsuite/btcutil" - "github.com/btcsuite/btcwallet/chain" - "github.com/btcsuite/btcwallet/waddrmgr" + "github.com/lbryio/lbcd/chaincfg/chainhash" + "github.com/lbryio/lbcd/wire" + btcutil "github.com/lbryio/lbcutil" + "github.com/lbryio/lbcwallet/chain" + "github.com/lbryio/lbcwallet/waddrmgr" ) type mockChainClient struct { diff --git a/wallet/multisig.go b/wallet/multisig.go index 7f66181..caf0caa 100644 --- a/wallet/multisig.go +++ b/wallet/multisig.go @@ -8,10 +8,10 @@ package wallet import ( "errors" - "github.com/btcsuite/btcd/txscript" - "github.com/btcsuite/btcutil" - "github.com/btcsuite/btcwallet/waddrmgr" - "github.com/btcsuite/btcwallet/walletdb" + "github.com/lbryio/lbcd/txscript" + btcutil "github.com/lbryio/lbcutil" + "github.com/lbryio/lbcwallet/waddrmgr" + "github.com/lbryio/lbcwallet/walletdb" ) // MakeMultiSigScript creates a multi-signature script that can be redeemed with diff --git a/wallet/notifications.go b/wallet/notifications.go index af8e2b2..65bd070 100644 --- a/wallet/notifications.go +++ b/wallet/notifications.go @@ -8,12 +8,12 @@ import ( "bytes" "sync" - "github.com/btcsuite/btcd/chaincfg/chainhash" - "github.com/btcsuite/btcd/txscript" - "github.com/btcsuite/btcutil" - "github.com/btcsuite/btcwallet/waddrmgr" - "github.com/btcsuite/btcwallet/walletdb" - "github.com/btcsuite/btcwallet/wtxmgr" + "github.com/lbryio/lbcd/chaincfg/chainhash" + "github.com/lbryio/lbcd/txscript" + btcutil "github.com/lbryio/lbcutil" + "github.com/lbryio/lbcwallet/waddrmgr" + "github.com/lbryio/lbcwallet/walletdb" + "github.com/lbryio/lbcwallet/wtxmgr" ) // TODO: It would be good to send errors during notification creation to the rpc diff --git a/wallet/psbt.go b/wallet/psbt.go index 400d4db..4d12813 100644 --- a/wallet/psbt.go +++ b/wallet/psbt.go @@ -8,15 +8,15 @@ import ( "bytes" "fmt" - "github.com/btcsuite/btcd/txscript" - "github.com/btcsuite/btcd/wire" - "github.com/btcsuite/btcutil" - "github.com/btcsuite/btcutil/psbt" - "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/wtxmgr" + "github.com/lbryio/lbcd/txscript" + "github.com/lbryio/lbcd/wire" + btcutil "github.com/lbryio/lbcutil" + "github.com/lbryio/lbcutil/psbt" + "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/wtxmgr" ) // FundPsbt creates a fully populated PSBT packet that contains enough inputs to diff --git a/wallet/psbt_test.go b/wallet/psbt_test.go index 1f053c2..d52ceea 100644 --- a/wallet/psbt_test.go +++ b/wallet/psbt_test.go @@ -10,11 +10,11 @@ import ( "strings" "testing" - "github.com/btcsuite/btcd/txscript" - "github.com/btcsuite/btcd/wire" - "github.com/btcsuite/btcutil" - "github.com/btcsuite/btcutil/psbt" - "github.com/btcsuite/btcwallet/waddrmgr" + "github.com/lbryio/lbcd/txscript" + "github.com/lbryio/lbcd/wire" + btcutil "github.com/lbryio/lbcutil" + "github.com/lbryio/lbcutil/psbt" + "github.com/lbryio/lbcwallet/waddrmgr" ) var ( diff --git a/wallet/recovery.go b/wallet/recovery.go index 2ed2b4b..83b7f6b 100644 --- a/wallet/recovery.go +++ b/wallet/recovery.go @@ -3,15 +3,15 @@ package wallet import ( "time" - "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/waddrmgr" - "github.com/btcsuite/btcwallet/walletdb" - "github.com/btcsuite/btcwallet/wtxmgr" + "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/waddrmgr" + "github.com/lbryio/lbcwallet/walletdb" + "github.com/lbryio/lbcwallet/wtxmgr" ) // RecoveryManager maintains the state required to recover previously used diff --git a/wallet/recovery_test.go b/wallet/recovery_test.go index efe31ff..fb934f6 100644 --- a/wallet/recovery_test.go +++ b/wallet/recovery_test.go @@ -4,7 +4,7 @@ import ( "runtime" "testing" - "github.com/btcsuite/btcwallet/wallet" + "github.com/lbryio/lbcwallet/wallet" ) // Harness holds the BranchRecoveryState being tested, the recovery window being diff --git a/wallet/rescan.go b/wallet/rescan.go index 1e5dbf4..a0c0b20 100644 --- a/wallet/rescan.go +++ b/wallet/rescan.go @@ -5,12 +5,12 @@ package wallet import ( - "github.com/btcsuite/btcd/txscript" - "github.com/btcsuite/btcd/wire" - "github.com/btcsuite/btcutil" - "github.com/btcsuite/btcwallet/chain" - "github.com/btcsuite/btcwallet/waddrmgr" - "github.com/btcsuite/btcwallet/wtxmgr" + "github.com/lbryio/lbcd/txscript" + "github.com/lbryio/lbcd/wire" + btcutil "github.com/lbryio/lbcutil" + "github.com/lbryio/lbcwallet/chain" + "github.com/lbryio/lbcwallet/waddrmgr" + "github.com/lbryio/lbcwallet/wtxmgr" ) // RescanProgressMsg reports the current progress made by a rescan for a diff --git a/wallet/signer.go b/wallet/signer.go index cf80ab4..343d408 100644 --- a/wallet/signer.go +++ b/wallet/signer.go @@ -7,11 +7,11 @@ package wallet import ( "fmt" - "github.com/btcsuite/btcd/btcec" - "github.com/btcsuite/btcd/txscript" - "github.com/btcsuite/btcd/wire" - "github.com/btcsuite/btcutil" - "github.com/btcsuite/btcwallet/waddrmgr" + "github.com/lbryio/lbcd/btcec" + "github.com/lbryio/lbcd/txscript" + "github.com/lbryio/lbcd/wire" + btcutil "github.com/lbryio/lbcutil" + "github.com/lbryio/lbcwallet/waddrmgr" ) // ScriptForOutput returns the address, witness program and redeem script for a diff --git a/wallet/signer_test.go b/wallet/signer_test.go index 7ee2e48..1fd4f9a 100644 --- a/wallet/signer_test.go +++ b/wallet/signer_test.go @@ -7,10 +7,10 @@ package wallet import ( "testing" - "github.com/btcsuite/btcd/txscript" - "github.com/btcsuite/btcd/wire" - "github.com/btcsuite/btcutil" - "github.com/btcsuite/btcwallet/waddrmgr" + "github.com/lbryio/lbcd/txscript" + "github.com/lbryio/lbcd/wire" + btcutil "github.com/lbryio/lbcutil" + "github.com/lbryio/lbcwallet/waddrmgr" ) // TestComputeInputScript checks that the wallet can create the full diff --git a/wallet/txauthor/author.go b/wallet/txauthor/author.go index f291772..69ca581 100644 --- a/wallet/txauthor/author.go +++ b/wallet/txauthor/author.go @@ -8,12 +8,12 @@ package txauthor import ( "errors" - "github.com/btcsuite/btcd/chaincfg" - "github.com/btcsuite/btcd/txscript" - "github.com/btcsuite/btcd/wire" - "github.com/btcsuite/btcutil" - "github.com/btcsuite/btcwallet/wallet/txrules" - "github.com/btcsuite/btcwallet/wallet/txsizes" + "github.com/lbryio/lbcd/chaincfg" + "github.com/lbryio/lbcd/txscript" + "github.com/lbryio/lbcd/wire" + btcutil "github.com/lbryio/lbcutil" + "github.com/lbryio/lbcwallet/wallet/txrules" + "github.com/lbryio/lbcwallet/wallet/txsizes" ) // SumOutputValues sums up the list of TxOuts and returns an Amount. diff --git a/wallet/txauthor/author_test.go b/wallet/txauthor/author_test.go index 2100518..629ee84 100644 --- a/wallet/txauthor/author_test.go +++ b/wallet/txauthor/author_test.go @@ -7,10 +7,10 @@ package txauthor import ( "testing" - "github.com/btcsuite/btcd/wire" - "github.com/btcsuite/btcutil" - "github.com/btcsuite/btcwallet/wallet/txrules" - "github.com/btcsuite/btcwallet/wallet/txsizes" + "github.com/lbryio/lbcd/wire" + btcutil "github.com/lbryio/lbcutil" + "github.com/lbryio/lbcwallet/wallet/txrules" + "github.com/lbryio/lbcwallet/wallet/txsizes" ) func p2pkhOutputs(amounts ...btcutil.Amount) []*wire.TxOut { diff --git a/wallet/txrules/rules.go b/wallet/txrules/rules.go index 7739c2c..f5e07c8 100644 --- a/wallet/txrules/rules.go +++ b/wallet/txrules/rules.go @@ -9,10 +9,10 @@ package txrules import ( "errors" - "github.com/btcsuite/btcd/mempool" - "github.com/btcsuite/btcd/txscript" - "github.com/btcsuite/btcd/wire" - "github.com/btcsuite/btcutil" + "github.com/lbryio/lbcd/mempool" + "github.com/lbryio/lbcd/txscript" + "github.com/lbryio/lbcd/wire" + btcutil "github.com/lbryio/lbcutil" ) // DefaultRelayFeePerKb is the default minimum relay fee policy for a mempool. diff --git a/wallet/txsizes/size.go b/wallet/txsizes/size.go index 1522e37..0390a65 100644 --- a/wallet/txsizes/size.go +++ b/wallet/txsizes/size.go @@ -5,9 +5,9 @@ package txsizes import ( - "github.com/btcsuite/btcd/blockchain" - "github.com/btcsuite/btcd/txscript" - "github.com/btcsuite/btcd/wire" + "github.com/lbryio/lbcd/blockchain" + "github.com/lbryio/lbcd/txscript" + "github.com/lbryio/lbcd/wire" ) // Worst case script and input/output size estimates. diff --git a/wallet/txsizes/size_test.go b/wallet/txsizes/size_test.go index 9f3cd0c..935750b 100644 --- a/wallet/txsizes/size_test.go +++ b/wallet/txsizes/size_test.go @@ -5,7 +5,7 @@ import ( "encoding/hex" "testing" - "github.com/btcsuite/btcd/wire" + "github.com/lbryio/lbcd/wire" ) const ( diff --git a/wallet/unstable.go b/wallet/unstable.go index 31f6889..321bd9d 100644 --- a/wallet/unstable.go +++ b/wallet/unstable.go @@ -6,9 +6,9 @@ package wallet import ( - "github.com/btcsuite/btcd/chaincfg/chainhash" - "github.com/btcsuite/btcwallet/walletdb" - "github.com/btcsuite/btcwallet/wtxmgr" + "github.com/lbryio/lbcd/chaincfg/chainhash" + "github.com/lbryio/lbcwallet/walletdb" + "github.com/lbryio/lbcwallet/wtxmgr" ) type unstableAPI struct { diff --git a/wallet/utxos.go b/wallet/utxos.go index dc1f209..a667df5 100644 --- a/wallet/utxos.go +++ b/wallet/utxos.go @@ -9,12 +9,12 @@ import ( "errors" "fmt" - "github.com/btcsuite/btcd/txscript" - "github.com/btcsuite/btcd/wire" - "github.com/btcsuite/btcutil/hdkeychain" - "github.com/btcsuite/btcutil/psbt" - "github.com/btcsuite/btcwallet/waddrmgr" - "github.com/btcsuite/btcwallet/walletdb" + "github.com/lbryio/lbcd/txscript" + "github.com/lbryio/lbcd/wire" + "github.com/lbryio/lbcutil/hdkeychain" + "github.com/lbryio/lbcutil/psbt" + "github.com/lbryio/lbcwallet/waddrmgr" + "github.com/lbryio/lbcwallet/walletdb" ) var ( diff --git a/wallet/utxos_test.go b/wallet/utxos_test.go index 744c97b..e42cc97 100644 --- a/wallet/utxos_test.go +++ b/wallet/utxos_test.go @@ -8,10 +8,10 @@ import ( "bytes" "testing" - "github.com/btcsuite/btcd/txscript" - "github.com/btcsuite/btcd/wire" - "github.com/btcsuite/btcutil/hdkeychain" - "github.com/btcsuite/btcwallet/waddrmgr" + "github.com/lbryio/lbcd/txscript" + "github.com/lbryio/lbcd/wire" + "github.com/lbryio/lbcutil/hdkeychain" + "github.com/lbryio/lbcwallet/waddrmgr" ) // TestFetchInputInfo checks that the wallet can gather information about an diff --git a/wallet/wallet.go b/wallet/wallet.go index bcfd2c5..86d9a40 100644 --- a/wallet/wallet.go +++ b/wallet/wallet.go @@ -15,23 +15,23 @@ import ( "sync" "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/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 ( @@ -1531,7 +1531,7 @@ func (w *Wallet) CalculateAccountBalances(account uint32, confirms int32) (Balan // CurrentAddress gets the most recently requested Bitcoin payment address // 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 -// 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) { chainClient, err := w.requireChainClient() 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. // // This error is returned when broadcasting/sending a transaction to a - // btcd node that already has it in their mempool. - // https://github.com/btcsuite/btcd/blob/130ea5bddde33df32b06a1cdb42a6316eb73cff5/mempool/mempool.go#L953 + // lbcd node that already has it in their mempool. + // https://github.com/lbryio/lbcd/blob/130ea5bddde33df32b06a1cdb42a6316eb73cff5/mempool/mempool.go#L953 case match(err, "already have transaction"): fallthrough @@ -3509,15 +3509,15 @@ func (w *Wallet) publishTransaction(tx *wire.MsgTx) (*chainhash.Hash, error) { // in a sense successful. // // This error is returned when sending a transaction that has already - // confirmed to a btcd/bitcoind node over RPC. - // https://github.com/btcsuite/btcd/blob/130ea5bddde33df32b06a1cdb42a6316eb73cff5/rpcserver.go#L3355 + // confirmed to a lbcd/bitcoind node over RPC. + // https://github.com/lbryio/lbcd/blob/130ea5bddde33df32b06a1cdb42a6316eb73cff5/rpcserver.go#L3355 // https://github.com/bitcoin/bitcoin/blob/9bf5768dd628b3a7c30dd42b5ed477a92c4d3540/src/node/transaction.cpp#L36 case rpcTxConfirmed: fallthrough // This error is returned when broadcasting a transaction that has - // already confirmed to a btcd node over the P2P network. - // https://github.com/btcsuite/btcd/blob/130ea5bddde33df32b06a1cdb42a6316eb73cff5/mempool/mempool.go#L1036 + // already confirmed to a lbcd node over the P2P network. + // https://github.com/lbryio/lbcd/blob/130ea5bddde33df32b06a1cdb42a6316eb73cff5/mempool/mempool.go#L1036 case match(err, "transaction already exists"): 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 // 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 // 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"): 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. - // 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"): 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 // 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"): fallthrough @@ -3608,13 +3608,13 @@ func (w *Wallet) publishTransaction(tx *wire.MsgTx) (*chainhash.Hash, error) { case match(err, "replacement-adds-unconfirmed"): fallthrough - // Returned by btcd when replacement transaction was rejected for + // Returned by lbcd when replacement transaction was rejected for // whatever reason. - // https://github.com/btcsuite/btcd/blob/130ea5bddde33df32b06a1cdb42a6316eb73cff5/mempool/mempool.go#L841 - // https://github.com/btcsuite/btcd/blob/130ea5bddde33df32b06a1cdb42a6316eb73cff5/mempool/mempool.go#L854 - // https://github.com/btcsuite/btcd/blob/130ea5bddde33df32b06a1cdb42a6316eb73cff5/mempool/mempool.go#L875 - // https://github.com/btcsuite/btcd/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#L841 + // https://github.com/lbryio/lbcd/blob/130ea5bddde33df32b06a1cdb42a6316eb73cff5/mempool/mempool.go#L854 + // https://github.com/lbryio/lbcd/blob/130ea5bddde33df32b06a1cdb42a6316eb73cff5/mempool/mempool.go#L875 + // https://github.com/lbryio/lbcd/blob/130ea5bddde33df32b06a1cdb42a6316eb73cff5/mempool/mempool.go#L896 + // https://github.com/lbryio/lbcd/blob/130ea5bddde33df32b06a1cdb42a6316eb73cff5/mempool/mempool.go#L913 case match(err, "replacement transaction"): returnErr = &ErrReplacement{ backendError: err, @@ -3655,7 +3655,7 @@ func (w *Wallet) ChainParams() *chaincfg.Params { } // 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. func (w *Wallet) Database() walletdb.DB { return w.db diff --git a/wallet/wallet_test.go b/wallet/wallet_test.go index 8490699..d2e6da2 100644 --- a/wallet/wallet_test.go +++ b/wallet/wallet_test.go @@ -5,10 +5,9 @@ import ( "testing" "time" - "github.com/btcsuite/btcwallet/walletdb" - "github.com/btcsuite/btcwallet/wtxmgr" - - "github.com/btcsuite/btcutil" + btcutil "github.com/lbryio/lbcutil" + "github.com/lbryio/lbcwallet/walletdb" + "github.com/lbryio/lbcwallet/wtxmgr" ) var ( diff --git a/wallet/watchingonly_test.go b/wallet/watchingonly_test.go index 64a72b0..9c07a75 100644 --- a/wallet/watchingonly_test.go +++ b/wallet/watchingonly_test.go @@ -10,8 +10,8 @@ import ( "testing" "time" - "github.com/btcsuite/btcd/chaincfg" - _ "github.com/btcsuite/btcwallet/walletdb/bdb" + "github.com/lbryio/lbcd/chaincfg" + _ "github.com/lbryio/lbcwallet/walletdb/bdb" ) // TestCreateWatchingOnly checks that we can construct a watching-only diff --git a/walletdb/README.md b/walletdb/README.md index 9ca5361..6e180c6 100644 --- a/walletdb/README.md +++ b/walletdb/README.md @@ -1,10 +1,10 @@ walletdb ======== -[![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) -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 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 -[![GoDoc](https://godoc.org/github.com/btcsuite/btcwallet/walletdb?status.png)] -(http://godoc.org/github.com/btcsuite/btcwallet/walletdb) +[![GoDoc](https://godoc.org/github.com/lbryio/lbcwallet/walletdb?status.png)] +(http://godoc.org/github.com/lbryio/lbcwallet/walletdb) Full `go doc` style documentation for the project can be viewed online without 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 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 ```bash -$ go get github.com/btcsuite/btcwallet/walletdb +$ go get github.com/lbryio/lbcwallet/walletdb ``` ## Examples * [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 managed read-write transaction against the namespace to store and retrieve data. diff --git a/walletdb/bdb/README.md b/walletdb/bdb/README.md index 0d7db3f..5f285af 100644 --- a/walletdb/bdb/README.md +++ b/walletdb/bdb/README.md @@ -1,8 +1,8 @@ bdb === -[![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) Package bdb implements an driver for walletdb that uses boltdb for the backing datastore. Package bdb is licensed under the copyfree ISC license. @@ -31,16 +31,16 @@ if err != nil { ## Documentation -[![GoDoc](https://godoc.org/github.com/btcsuite/btcwallet/walletdb/bdb?status.png)] -(http://godoc.org/github.com/btcsuite/btcwallet/walletdb/bdb) +[![GoDoc](https://godoc.org/github.com/lbryio/lbcwallet/walletdb/bdb?status.png)] +(http://godoc.org/github.com/lbryio/lbcwallet/walletdb/bdb) Full `go doc` style documentation for the project can be viewed online without 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 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 diff --git a/walletdb/bdb/db.go b/walletdb/bdb/db.go index f9ccc2d..4ff9dc6 100644 --- a/walletdb/bdb/db.go +++ b/walletdb/bdb/db.go @@ -9,7 +9,7 @@ import ( "os" "time" - "github.com/btcsuite/btcwallet/walletdb" + "github.com/lbryio/lbcwallet/walletdb" "go.etcd.io/bbolt" ) diff --git a/walletdb/bdb/driver.go b/walletdb/bdb/driver.go index da4ad26..a6aa324 100644 --- a/walletdb/bdb/driver.go +++ b/walletdb/bdb/driver.go @@ -8,7 +8,7 @@ import ( "fmt" "time" - "github.com/btcsuite/btcwallet/walletdb" + "github.com/lbryio/lbcwallet/walletdb" ) const ( diff --git a/walletdb/bdb/driver_test.go b/walletdb/bdb/driver_test.go index df88d49..b4961a5 100644 --- a/walletdb/bdb/driver_test.go +++ b/walletdb/bdb/driver_test.go @@ -13,8 +13,8 @@ import ( "testing" "time" - "github.com/btcsuite/btcwallet/walletdb" - _ "github.com/btcsuite/btcwallet/walletdb/bdb" + "github.com/lbryio/lbcwallet/walletdb" + _ "github.com/lbryio/lbcwallet/walletdb/bdb" ) const ( diff --git a/walletdb/bdb/interface_test.go b/walletdb/bdb/interface_test.go index 4bfddb0..fa9c5f6 100644 --- a/walletdb/bdb/interface_test.go +++ b/walletdb/bdb/interface_test.go @@ -18,7 +18,7 @@ import ( "path/filepath" "testing" - "github.com/btcsuite/btcwallet/walletdb/walletdbtest" + "github.com/lbryio/lbcwallet/walletdb/walletdbtest" ) // TestInterface performs all interfaces tests for this database driver. diff --git a/walletdb/db_test.go b/walletdb/db_test.go index 9e8760a..991c84f 100644 --- a/walletdb/db_test.go +++ b/walletdb/db_test.go @@ -12,8 +12,8 @@ import ( "testing" "time" - "github.com/btcsuite/btcwallet/walletdb" - _ "github.com/btcsuite/btcwallet/walletdb/bdb" + "github.com/lbryio/lbcwallet/walletdb" + _ "github.com/lbryio/lbcwallet/walletdb/bdb" ) var ( diff --git a/walletdb/doc.go b/walletdb/doc.go index ba52643..9c1e992 100644 --- a/walletdb/doc.go +++ b/walletdb/doc.go @@ -3,7 +3,7 @@ // 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 diff --git a/walletdb/example_test.go b/walletdb/example_test.go index c9640ab..4548b55 100644 --- a/walletdb/example_test.go +++ b/walletdb/example_test.go @@ -10,8 +10,8 @@ import ( "os" "path/filepath" - "github.com/btcsuite/btcwallet/walletdb" - _ "github.com/btcsuite/btcwallet/walletdb/bdb" + "github.com/lbryio/lbcwallet/walletdb" + _ "github.com/lbryio/lbcwallet/walletdb/bdb" ) // This example demonstrates creating a new database. @@ -19,8 +19,8 @@ func ExampleCreate() { // This example assumes the bdb (bolt db) driver is imported. // // import ( - // "github.com/btcsuite/btcwallet/walletdb" - // _ "github.com/btcsuite/btcwallet/walletdb/bdb" + // "github.com/lbryio/lbcwallet/walletdb" + // _ "github.com/lbryio/lbcwallet/walletdb/bdb" // ) // 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. // // import ( - // "github.com/btcsuite/btcwallet/walletdb" - // _ "github.com/btcsuite/btcwallet/walletdb/bdb" + // "github.com/lbryio/lbcwallet/walletdb" + // _ "github.com/lbryio/lbcwallet/walletdb/bdb" // ) // Create a database and schedule it to be closed and removed on exit. diff --git a/walletdb/migration/manager.go b/walletdb/migration/manager.go index 29240cf..f419a10 100644 --- a/walletdb/migration/manager.go +++ b/walletdb/migration/manager.go @@ -4,7 +4,7 @@ import ( "errors" "sort" - "github.com/btcsuite/btcwallet/walletdb" + "github.com/lbryio/lbcwallet/walletdb" ) var ( diff --git a/walletdb/migration/manager_test.go b/walletdb/migration/manager_test.go index 9aa550b..e6db561 100644 --- a/walletdb/migration/manager_test.go +++ b/walletdb/migration/manager_test.go @@ -6,9 +6,9 @@ import ( "reflect" "testing" - "github.com/btcsuite/btcwallet/walletdb" - "github.com/btcsuite/btcwallet/walletdb/migration" "github.com/davecgh/go-spew/spew" + "github.com/lbryio/lbcwallet/walletdb" + "github.com/lbryio/lbcwallet/walletdb/migration" ) type mockMigrationManager struct { diff --git a/walletdb/test_coverage.txt b/walletdb/test_coverage.txt index f86532e..3309326 100644 --- a/walletdb/test_coverage.txt +++ b/walletdb/test_coverage.txt @@ -1,39 +1,39 @@ PASS coverage: 100.0% of statements -ok github.com/conformal/btcwallet/walletdb 0.130s -github.com\conformal\btcwallet\walletdb\interface.go:190: RegisterDriver 100.0% -github.com\conformal\btcwallet\walletdb\interface.go:201: SupportedDrivers 100.0% -github.com\conformal\btcwallet\walletdb\interface.go:214: Create 100.0% -github.com\conformal\btcwallet\walletdb\interface.go:228: Open 100.0% +ok github.com/lbryio/lbcwallet/walletdb 0.130s +github.com\lbryio\lbcwallet\walletdb\interface.go:190: RegisterDriver 100.0% +github.com\lbryio\lbcwallet\walletdb\interface.go:201: SupportedDrivers 100.0% +github.com\lbryio\lbcwallet\walletdb\interface.go:214: Create 100.0% +github.com\lbryio\lbcwallet\walletdb\interface.go:228: Open 100.0% total: (statements) 100.0% ============================================================ PASS coverage: 91.7% of statements -ok github.com/conformal/btcwallet/walletdb/bdb 0.149s -github.com\conformal\btcwallet\walletdb\bdb\db.go:28: convertErr 76.9% -github.com\conformal\btcwallet\walletdb\bdb\db.go:74: Bucket 100.0% -github.com\conformal\btcwallet\walletdb\bdb\db.go:90: CreateBucket 100.0% -github.com\conformal\btcwallet\walletdb\bdb\db.go:103: CreateBucketIfNotExists 100.0% -github.com\conformal\btcwallet\walletdb\bdb\db.go:116: DeleteBucket 100.0% -github.com\conformal\btcwallet\walletdb\bdb\db.go:129: ForEach 100.0% -github.com\conformal\btcwallet\walletdb\bdb\db.go:136: Writable 100.0% -github.com\conformal\btcwallet\walletdb\bdb\db.go:145: Put 100.0% -github.com\conformal\btcwallet\walletdb\bdb\db.go:157: Get 100.0% -github.com\conformal\btcwallet\walletdb\bdb\db.go:166: Delete 100.0% -github.com\conformal\btcwallet\walletdb\bdb\db.go:185: RootBucket 100.0% -github.com\conformal\btcwallet\walletdb\bdb\db.go:193: Commit 100.0% -github.com\conformal\btcwallet\walletdb\bdb\db.go:201: Rollback 100.0% -github.com\conformal\btcwallet\walletdb\bdb\db.go:227: Begin 85.7% -github.com\conformal\btcwallet\walletdb\bdb\db.go:249: View 100.0% -github.com\conformal\btcwallet\walletdb\bdb\db.go:270: Update 100.0% -github.com\conformal\btcwallet\walletdb\bdb\db.go:294: Namespace 93.3% -github.com\conformal\btcwallet\walletdb\bdb\db.go:329: DeleteNamespace 100.0% -github.com\conformal\btcwallet\walletdb\bdb\db.go:339: WriteTo 0.0% -github.com\conformal\btcwallet\walletdb\bdb\db.go:348: Close 100.0% -github.com\conformal\btcwallet\walletdb\bdb\db.go:353: fileExists 100.0% -github.com\conformal\btcwallet\walletdb\bdb\db.go:364: openDB 100.0% -github.com\conformal\btcwallet\walletdb\bdb\driver.go:34: parseArgs 100.0% -github.com\conformal\btcwallet\walletdb\bdb\driver.go:50: openDBDriver 100.0% -github.com\conformal\btcwallet\walletdb\bdb\driver.go:60: createDBDriver 100.0% -github.com\conformal\btcwallet\walletdb\bdb\driver.go:69: init 66.7% +ok github.com/lbryio/lbcwallet/walletdb/bdb 0.149s +github.com\lbryio\lbcwallet\walletdb\bdb\db.go:28: convertErr 76.9% +github.com\lbryio\lbcwallet\walletdb\bdb\db.go:74: Bucket 100.0% +github.com\lbryio\lbcwallet\walletdb\bdb\db.go:90: CreateBucket 100.0% +github.com\lbryio\lbcwallet\walletdb\bdb\db.go:103: CreateBucketIfNotExists 100.0% +github.com\lbryio\lbcwallet\walletdb\bdb\db.go:116: DeleteBucket 100.0% +github.com\lbryio\lbcwallet\walletdb\bdb\db.go:129: ForEach 100.0% +github.com\lbryio\lbcwallet\walletdb\bdb\db.go:136: Writable 100.0% +github.com\lbryio\lbcwallet\walletdb\bdb\db.go:145: Put 100.0% +github.com\lbryio\lbcwallet\walletdb\bdb\db.go:157: Get 100.0% +github.com\lbryio\lbcwallet\walletdb\bdb\db.go:166: Delete 100.0% +github.com\lbryio\lbcwallet\walletdb\bdb\db.go:185: RootBucket 100.0% +github.com\lbryio\lbcwallet\walletdb\bdb\db.go:193: Commit 100.0% +github.com\lbryio\lbcwallet\walletdb\bdb\db.go:201: Rollback 100.0% +github.com\lbryio\lbcwallet\walletdb\bdb\db.go:227: Begin 85.7% +github.com\lbryio\lbcwallet\walletdb\bdb\db.go:249: View 100.0% +github.com\lbryio\lbcwallet\walletdb\bdb\db.go:270: Update 100.0% +github.com\lbryio\lbcwallet\walletdb\bdb\db.go:294: Namespace 93.3% +github.com\lbryio\lbcwallet\walletdb\bdb\db.go:329: DeleteNamespace 100.0% +github.com\lbryio\lbcwallet\walletdb\bdb\db.go:339: WriteTo 0.0% +github.com\lbryio\lbcwallet\walletdb\bdb\db.go:348: Close 100.0% +github.com\lbryio\lbcwallet\walletdb\bdb\db.go:353: fileExists 100.0% +github.com\lbryio\lbcwallet\walletdb\bdb\db.go:364: openDB 100.0% +github.com\lbryio\lbcwallet\walletdb\bdb\driver.go:34: parseArgs 100.0% +github.com\lbryio\lbcwallet\walletdb\bdb\driver.go:50: openDBDriver 100.0% +github.com\lbryio\lbcwallet\walletdb\bdb\driver.go:60: createDBDriver 100.0% +github.com\lbryio\lbcwallet\walletdb\bdb\driver.go:69: init 66.7% total: (statements) 91.7% diff --git a/walletdb/walletdbtest/interface.go b/walletdb/walletdbtest/interface.go index da17f12..0648c79 100644 --- a/walletdb/walletdbtest/interface.go +++ b/walletdb/walletdbtest/interface.go @@ -10,7 +10,7 @@ import ( "reflect" "sync" - "github.com/btcsuite/btcwallet/walletdb" + "github.com/lbryio/lbcwallet/walletdb" ) // errSubTestFail is used to signal that a sub test returned false. diff --git a/walletsetup.go b/walletsetup.go index e317741..2305fe3 100644 --- a/walletsetup.go +++ b/walletsetup.go @@ -11,15 +11,15 @@ import ( "path/filepath" "time" - "github.com/btcsuite/btcd/chaincfg" - "github.com/btcsuite/btcd/wire" - "github.com/btcsuite/btcutil" - "github.com/btcsuite/btcwallet/internal/legacy/keystore" - "github.com/btcsuite/btcwallet/internal/prompt" - "github.com/btcsuite/btcwallet/waddrmgr" - "github.com/btcsuite/btcwallet/wallet" - "github.com/btcsuite/btcwallet/walletdb" - _ "github.com/btcsuite/btcwallet/walletdb/bdb" + "github.com/lbryio/lbcd/chaincfg" + "github.com/lbryio/lbcd/wire" + btcutil "github.com/lbryio/lbcutil" + "github.com/lbryio/lbcwallet/internal/legacy/keystore" + "github.com/lbryio/lbcwallet/internal/prompt" + "github.com/lbryio/lbcwallet/waddrmgr" + "github.com/lbryio/lbcwallet/wallet" + "github.com/lbryio/lbcwallet/walletdb" + _ "github.com/lbryio/lbcwallet/walletdb/bdb" ) // networkDir returns the directory name of a network directory to hold wallet diff --git a/wtxmgr/README.md b/wtxmgr/README.md index 1cd2676..0049a36 100644 --- a/wtxmgr/README.md +++ b/wtxmgr/README.md @@ -1,8 +1,8 @@ wtxmgr ====== -[![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) Package wtxmgr provides storage and spend tracking of wallet transactions and their relevant input and outputs. @@ -21,24 +21,24 @@ their relevant input and outputs. - Programmatically detectable errors, including encapsulation of errors from packages it relies on - Operates under its own walletdb namespace - + ## Documentation -[![GoDoc](https://godoc.org/github.com/btcsuite/btcwallet/wtxmgr?status.png)] -(http://godoc.org/github.com/btcsuite/btcwallet/wtxmgr) +[![GoDoc](https://godoc.org/github.com/lbryio/lbcwallet/wtxmgr?status.png)] +(http://godoc.org/github.com/lbryio/lbcwallet/wtxmgr) Full `go doc` style documentation for the project can be viewed online without installing this package by using the GoDoc site here: -http://godoc.org/github.com/btcsuite/btcwallet/wtxmgr +http://godoc.org/github.com/lbryio/lbcwallet/wtxmgr 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 -http://localhost:6060/pkg/github.com/btcsuite/btcwallet/wtxmgr +http://localhost:6060/pkg/github.com/lbryio/lbcwallet/wtxmgr ## Installation ```bash -$ go get github.com/btcsuite/btcwallet/wtxmgr +$ go get github.com/lbryio/lbcwallet/wtxmgr ``` Package wtxmgr is licensed under the [copyfree](http://copyfree.org) ISC diff --git a/wtxmgr/db.go b/wtxmgr/db.go index 201c37c..aa6c72f 100644 --- a/wtxmgr/db.go +++ b/wtxmgr/db.go @@ -11,10 +11,10 @@ import ( "fmt" "time" - "github.com/btcsuite/btcd/chaincfg/chainhash" - "github.com/btcsuite/btcd/wire" - "github.com/btcsuite/btcutil" - "github.com/btcsuite/btcwallet/walletdb" + "github.com/lbryio/lbcd/chaincfg/chainhash" + "github.com/lbryio/lbcd/wire" + btcutil "github.com/lbryio/lbcutil" + "github.com/lbryio/lbcwallet/walletdb" ) // Naming diff --git a/wtxmgr/example_test.go b/wtxmgr/example_test.go index 3ef60a4..84da5d7 100644 --- a/wtxmgr/example_test.go +++ b/wtxmgr/example_test.go @@ -7,19 +7,19 @@ package wtxmgr import ( "fmt" - "github.com/btcsuite/btcd/chaincfg" - "github.com/btcsuite/btcd/chaincfg/chainhash" - "github.com/btcsuite/btcd/wire" - "github.com/btcsuite/btcwallet/walletdb" + "github.com/lbryio/lbcd/chaincfg" + "github.com/lbryio/lbcd/chaincfg/chainhash" + "github.com/lbryio/lbcd/wire" + "github.com/lbryio/lbcwallet/walletdb" ) var ( // Spends: bogus - // Outputs: 10 BTC + // Outputs: 10 LBC exampleTxRecordA *TxRecord // Spends: A:0 - // Outputs: 5 BTC, 5 BTC + // Outputs: 5 LBC, 5 LBC exampleTxRecordB *TxRecord ) @@ -61,17 +61,17 @@ func ExampleStore_Balance() { } defer dbtx.Rollback() ns := dbtx.ReadBucket(namespaceKey) - zeroConfBal, err := s.Balance(ns, 0, syncHeight) + zeroConfBal, _, err := s.Balance(ns, 0, syncHeight) if err != nil { fmt.Println(err) return } - oneConfBal, err := s.Balance(ns, 1, syncHeight) + oneConfBal, _, err := s.Balance(ns, 1, syncHeight) if err != nil { fmt.Println(err) return } - sixConfBal, err := s.Balance(ns, 6, syncHeight) + sixConfBal, _, err := s.Balance(ns, 6, syncHeight) if err != nil { fmt.Println(err) return @@ -79,7 +79,7 @@ func ExampleStore_Balance() { fmt.Printf("%v, %v, %v\n", zeroConfBal, oneConfBal, sixConfBal) } - // Insert a transaction which outputs 10 BTC unmined and mark the output + // Insert a transaction which outputs 10 LBC unmined and mark the output // as a credit. err = walletdb.Update(db, func(tx walletdb.ReadWriteTx) error { ns := tx.ReadWriteBucket(namespaceKey) @@ -109,9 +109,9 @@ func ExampleStore_Balance() { printBalances(105) // Output: - // 10 BTC, 0 BTC, 0 BTC - // 10 BTC, 10 BTC, 0 BTC - // 10 BTC, 10 BTC, 10 BTC + // 10 LBC, 0 LBC, 0 LBC + // 10 LBC, 10 LBC, 0 LBC + // 10 LBC, 10 LBC, 10 LBC } func ExampleStore_Rollback() { @@ -125,7 +125,7 @@ func ExampleStore_Rollback() { err = walletdb.Update(db, func(tx walletdb.ReadWriteTx) error { ns := tx.ReadWriteBucket(namespaceKey) - // Insert a transaction which outputs 10 BTC in a block at height 100. + // Insert a transaction which outputs 10 LBC in a block at height 100. err := s.InsertTx(ns, exampleTxRecordA, &exampleBlock100) if err != nil { return err @@ -193,7 +193,7 @@ func Example_basicUsage() { return } - // Insert an unmined transaction that outputs 10 BTC to a wallet address + // Insert an unmined transaction that outputs 10 LBC to a wallet address // at output 0. err = s.InsertTx(b, exampleTxRecordA, nil) if err != nil { @@ -207,7 +207,7 @@ func Example_basicUsage() { } // Insert a second transaction which spends the output, and creates two - // outputs. Mark the second one (5 BTC) as wallet change. + // outputs. Mark the second one (5 LBC) as wallet change. err = s.InsertTx(b, exampleTxRecordB, nil) if err != nil { fmt.Println(err) @@ -250,6 +250,6 @@ func Example_basicUsage() { } // Output: - // 5 BTC + // 5 LBC // true } diff --git a/wtxmgr/kahnsort.go b/wtxmgr/kahnsort.go index efb85ac..82c17a8 100644 --- a/wtxmgr/kahnsort.go +++ b/wtxmgr/kahnsort.go @@ -5,8 +5,8 @@ package wtxmgr import ( - "github.com/btcsuite/btcd/chaincfg/chainhash" - "github.com/btcsuite/btcd/wire" + "github.com/lbryio/lbcd/chaincfg/chainhash" + "github.com/lbryio/lbcd/wire" ) type graphNode struct { diff --git a/wtxmgr/kahnsort_test.go b/wtxmgr/kahnsort_test.go index 770e651..754b8c6 100644 --- a/wtxmgr/kahnsort_test.go +++ b/wtxmgr/kahnsort_test.go @@ -5,9 +5,9 @@ import ( "reflect" "testing" - "github.com/btcsuite/btcd/chaincfg/chainhash" - "github.com/btcsuite/btcd/wire" - "github.com/btcsuite/btcwallet/wtxmgr" + "github.com/lbryio/lbcd/chaincfg/chainhash" + "github.com/lbryio/lbcd/wire" + "github.com/lbryio/lbcwallet/wtxmgr" ) // createTx is a helper method to create random transactions that spend diff --git a/wtxmgr/migrations.go b/wtxmgr/migrations.go index 2c4fa93..6b97d94 100644 --- a/wtxmgr/migrations.go +++ b/wtxmgr/migrations.go @@ -1,8 +1,8 @@ package wtxmgr import ( - "github.com/btcsuite/btcwallet/walletdb" - "github.com/btcsuite/btcwallet/walletdb/migration" + "github.com/lbryio/lbcwallet/walletdb" + "github.com/lbryio/lbcwallet/walletdb/migration" ) // versions is a list of the different database versions. The last entry should diff --git a/wtxmgr/migrations_test.go b/wtxmgr/migrations_test.go index 3f15d57..50615c6 100644 --- a/wtxmgr/migrations_test.go +++ b/wtxmgr/migrations_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/btcsuite/btcwallet/walletdb" + "github.com/lbryio/lbcwallet/walletdb" ) // applyMigration is a helper function that allows us to assert the state of the diff --git a/wtxmgr/query.go b/wtxmgr/query.go index 2ba8b3b..2616a3d 100644 --- a/wtxmgr/query.go +++ b/wtxmgr/query.go @@ -8,9 +8,9 @@ package wtxmgr import ( "fmt" - "github.com/btcsuite/btcd/chaincfg/chainhash" - "github.com/btcsuite/btcutil" - "github.com/btcsuite/btcwallet/walletdb" + "github.com/lbryio/lbcd/chaincfg/chainhash" + btcutil "github.com/lbryio/lbcutil" + "github.com/lbryio/lbcwallet/walletdb" ) // CreditRecord contains metadata regarding a transaction credit for a known diff --git a/wtxmgr/query_test.go b/wtxmgr/query_test.go index 0cf702d..3aa0bb1 100644 --- a/wtxmgr/query_test.go +++ b/wtxmgr/query_test.go @@ -12,10 +12,10 @@ import ( "testing" "time" - "github.com/btcsuite/btcd/chaincfg/chainhash" - "github.com/btcsuite/btcd/wire" - "github.com/btcsuite/btcutil" - "github.com/btcsuite/btcwallet/walletdb" + "github.com/lbryio/lbcd/chaincfg/chainhash" + "github.com/lbryio/lbcd/wire" + btcutil "github.com/lbryio/lbcutil" + "github.com/lbryio/lbcwallet/walletdb" ) type queryState struct { @@ -310,7 +310,7 @@ func TestStoreQueries(t *testing.T) { }) // Insert another unmined transaction which spends txA:0, splitting the - // amount into outputs of 40 and 60 BTC. + // amount into outputs of 40 and 60 LBC. txB := spendOutput(&recA.Hash, 0, 40e8, 60e8) recB, err := NewTxRecordFromMsgTx(txB, timeNow()) if err != nil { diff --git a/wtxmgr/tx.go b/wtxmgr/tx.go index d1f4a10..684491c 100644 --- a/wtxmgr/tx.go +++ b/wtxmgr/tx.go @@ -12,12 +12,12 @@ import ( "fmt" "time" - "github.com/btcsuite/btcd/blockchain" - "github.com/btcsuite/btcd/chaincfg" - "github.com/btcsuite/btcd/chaincfg/chainhash" - "github.com/btcsuite/btcd/wire" - "github.com/btcsuite/btcutil" - "github.com/btcsuite/btcwallet/walletdb" + "github.com/lbryio/lbcd/blockchain" + "github.com/lbryio/lbcd/chaincfg" + "github.com/lbryio/lbcd/chaincfg/chainhash" + "github.com/lbryio/lbcd/wire" + btcutil "github.com/lbryio/lbcutil" + "github.com/lbryio/lbcwallet/walletdb" "github.com/lightningnetwork/lnd/clock" ) diff --git a/wtxmgr/tx_test.go b/wtxmgr/tx_test.go index 1b4edad..dc482ad 100644 --- a/wtxmgr/tx_test.go +++ b/wtxmgr/tx_test.go @@ -14,12 +14,12 @@ import ( "testing" "time" - "github.com/btcsuite/btcd/chaincfg" - "github.com/btcsuite/btcd/chaincfg/chainhash" - "github.com/btcsuite/btcd/wire" - "github.com/btcsuite/btcutil" - "github.com/btcsuite/btcwallet/walletdb" - _ "github.com/btcsuite/btcwallet/walletdb/bdb" + "github.com/lbryio/lbcd/chaincfg" + "github.com/lbryio/lbcd/chaincfg/chainhash" + "github.com/lbryio/lbcd/wire" + btcutil "github.com/lbryio/lbcutil" + "github.com/lbryio/lbcwallet/walletdb" + _ "github.com/lbryio/lbcwallet/walletdb/bdb" "github.com/lightningnetwork/lnd/clock" ) @@ -115,7 +115,7 @@ func TestInsertsCreditsDebitsRollbacks(t *testing.T) { // Create a double spend of the received blockchain transaction. dupRecvTx, _ := btcutil.NewTxFromBytes(TstRecvSerializedTx) - // Switch txout amount to 1 BTC. Transaction store doesn't + // Switch txout amount to 1 LBC. Transaction store doesn't // validate txs, so this is fine for testing a double spend // removal. TstDupRecvAmount := int64(1e8) @@ -730,7 +730,7 @@ func TestCoinbases(t *testing.T) { coinbaseMaturity := int32(chaincfg.TestNet3Params.CoinbaseMaturity) - // Balance should be 0 if the coinbase is immature, 50 BTC at and beyond + // Balance should be 0 if the coinbase is immature, 50 LBC at and beyond // maturity. // // Outputs when depth is below maturity are never included, no matter diff --git a/wtxmgr/unconfirmed.go b/wtxmgr/unconfirmed.go index e02b4c0..c7b4125 100644 --- a/wtxmgr/unconfirmed.go +++ b/wtxmgr/unconfirmed.go @@ -6,9 +6,9 @@ package wtxmgr import ( - "github.com/btcsuite/btcd/chaincfg/chainhash" - "github.com/btcsuite/btcd/wire" - "github.com/btcsuite/btcwallet/walletdb" + "github.com/lbryio/lbcd/chaincfg/chainhash" + "github.com/lbryio/lbcd/wire" + "github.com/lbryio/lbcwallet/walletdb" ) // insertMemPoolTx inserts the unmined transaction record. It also marks