Use the Gradle java-library plugin to make Guava an `api`
dependency since Guava types are used in the bitcoinj public API.
This allows us to remove explicit dependencies on
Guava in the other modules.
Coin selection is a per SendRequest, per createSend() or per getBalance() call affair.
Having it wallet-global can lead to race conditions, as sometimes experienced in the
WalletTest unit tests.
This allows usage in both wallettemplate and tools and replaces
similar code in BlockFileLoader.java in core.
Requires minor back-port of Path.of() functionality from JDK11.
Previously WalletTemplate would store the .spvchain and .wallet files
in the app’s current working directory which could vary depending upon
how the app was launched.
This PR stores the app’s data files in the “app data directory” which
is always named “WalletTemplate” (APP_NAME) and located in the standard
location for application data directories on the current OS platform.
For macOS: `~/Library/Application Support/WalletTemplate`
For Linux/unix: `~/.WalletTemplate`
For Windows: ${APPDATA}/WalletTemplate (where APPDATA is a standard
Windows environment variable)
Changes:
* Added AppDataDirectory class to return current dir Path
* Modified Main to use appDataDirectory rather than “.”
- Hierarchical-deterministic derivation of native segwit addresses.
- Receive payments to native segwit addresses.
- Spend and sign payments from native segwit addresses.
- Watch-only wallets with native segwit addresses (zpub/vpub).
- WalletAppKit, Wallet-tool and Wallet-template are taught to deal with segwit-enabled wallets.
Be aware this adds a new field in the wallet protobuf: output_script_type in Key, which keeps track
of the script type of DeterministicKeyChains. Protobufs will be migrated; old DeterministicKeyChains
are assumed to be of type P2PKH.
Includes some code by Fabrice Drouin.
In the test data for DeterministicKeyChainTest all occurences of the (often invisible) 0x7f
character is replaced by its numerical literal "\177". This change is needed because a bug of
previous versions was fixed, which caused this character not being printed as text.