Commit graph

151 commits

Author SHA1 Message Date
Sean Gilligan
17aeea2d75 walletfx: move OverlayUI from Main to MainController
Move OverlayUI and other related functionality from Main (Application) class
to MainController.

Motivation:

1. This simplifies the Main class
2. The code more logically belongs in the controller
3. The code being in the controller increases reusability
4. Is a first step towards additional refactoring made possible
   because MainController can subclass an abstract class and Main
   can’t because it must subclass Application
2021-09-19 19:04:12 +02:00
Sean Gilligan
1e7fc7aad5 walletfx: Hook up the unused “Primary” and “Secondary” buttons
I did this for two reasons:

1. So users will know why the buttons are there and that they work
2. A convenient way to test the informational alert function.
2021-09-18 17:42:33 -07:00
Sean Gilligan
e9980e73fa wallettemplate: rename package wallettemplate.utils to org.bitcoinj.walletfx.utils
This is a step towards (a renewed effort at) separating the wallettemplate
into a JavaFX wallet library and a template application.
2021-09-18 19:03:17 +02:00
Andreas Schildbach
a966cd38a1 Apply "Lambda can be replaced with method reference" refactoring. 2020-09-07 21:15:51 +02:00
Andreas Schildbach
e7b00b65f9 Apply "Statement lambda can be replaced with expression lambda" refactoring. 2020-09-07 21:13:14 +02:00
Andreas Schildbach
c08a4d97d3 Apply "Anonymous type can be replaced with lambda" refactoring. 2020-09-07 21:13:14 +02:00
Andreas Schildbach
4847a9df27 Apply "Explicit generic type can be replaced with <>" refactoring. 2020-09-07 21:10:44 +02:00
Andreas Schildbach
726c7291ac Wallet: Remove global coinSelector and allowSpendingUnconfirmedTransactions().
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.
2019-07-26 20:30:27 +02:00
Sean Gilligan
3c5744a6cb AppDataDirectory: Move from wallettemplate/.utils to core/.utils
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.
2019-06-20 10:09:21 +02:00
Sean Gilligan
d446951ceb AppDataDirectory: Use lower-case appName for data dir on Windows/Linux/Unix. 2019-06-19 21:27:01 +02:00
Andreas Schildbach
ab2fb2f9cf KeyChainGroup: New CurrentKeyChangeEventListener that fires when a current key and/or address changes.
This also changes wallet-template to make use of the new listener for updating its current address in the UI.
2019-05-19 08:23:39 +02:00
Sean Gilligan
46195cd24e wallet-template: Put wallet data files in app data directory.
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 “.”
2019-04-29 10:29:45 +02:00
Sean Gilligan
88dd0028cd ClickableBitcoinAddress: Break out QRCodeImages utility class for QR Code FX image creation. 2019-04-24 11:21:12 +02:00
Sean Gilligan
2dbe4f21bc Use TestNet3 in WalletTemplate.
WalletTemplate is not a production-ready wallet and (for now, at least)
should default (currently hard-coded) to TestNet3.
2019-04-23 17:12:38 +02:00
Sean Gilligan
c2253d2e97 MainController: Replace EasyBind with two static methods.
This removes the dependency on EasyBind.
2019-04-22 09:06:09 +02:00
Sean Gilligan
3538d3342e ClickableBitcoinAddress: Write QR code directly to a JavaFX image, rather than transitioning through a PNG image.
This gets rid of the ZXing-JavaSE dependency.
2019-04-07 11:34:45 +02:00
Sean Gilligan
560e128458 build.gradle: Replace usage of QRGen by direct usage of ZXing 3.3.3 for generating QR codes. 2019-04-06 17:14:59 +02:00
Andreas Schildbach
f24a4aa19a Update Guava to 27.0.1-android. 2019-02-15 03:34:11 +01:00
Andreas Schildbach
bfe2a195b6 Receive to and send from native segwit addresses
- 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.
2019-02-11 16:48:37 +01:00
Andreas Schildbach
0d90157749 Wallet-template: Allow sending to Bech32 addresses. 2019-02-06 12:02:31 +01:00
Nicola Atzei
0833fe1cea In JavaDocs change <tt> tags to @code. 2019-01-04 18:36:59 +01:00
Andreas Schildbach
ad262de961 Migrate from SpongyCastle back to BouncyCastle.
Google moved their broken BouncyCastle out of the way with Android 3.0
(see 0ac85ead96%5E%21/).
2018-10-23 16:09:10 +02:00
Andreas Schildbach
8ee5e48171 Update to protobuf-java 3.5.1.
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.
2018-03-13 21:55:47 +01:00
Andreas Schildbach
c35d892fa6 Add Utils.isLinux() and Utils.isMac() helpers. 2018-03-13 13:05:59 +01:00
Andreas Schildbach
4bbb7be059 Migrate fully qualified names to using imports. 2018-03-11 21:36:25 +01:00
Andreas Schildbach
fa5bdbb672 JavaDoc: Fix HTML structure. 2018-03-11 20:40:28 +01:00
Andreas Schildbach
7f5b6753f5 Use Address whereever possible in the API, rather than LegacyAddress.
This is a preparation for the remaining segwit changes. LegacyAddress
variables in unit tests are also changed.
2018-03-05 10:35:09 +01:00
Andreas Schildbach
e11119b64f Rename VersionedChecksummedBytes→PrefixedChecksummedBytes, Address→LegacyAddress and AbstractAddress→Address.
This also renames corresponding test classes and mentions in comments.
2018-02-28 16:57:16 +01:00
Andreas Schildbach
71a5b1b89f Remove some unused imports. 2018-02-23 20:09:41 +01:00
Andreas Schildbach
afc198600a Utils: Inline join(). 2017-06-02 16:55:40 +02:00
Andreas Schildbach
7e609a2409 Remove Orchid forked subproject and support for connecting via Tor. 2016-11-25 23:14:39 +01:00
Andreas Schildbach
3773a4343c Add a generic copyright statement to all license headers that don't have one.
Note it is not legally necessary to state copyright, but we think it makes things easier.
2016-06-06 21:32:02 +02:00
Andreas Schildbach
4e29e4fb00 Wallet: Make SendRequest a top level class. 2016-04-01 22:03:14 +02:00
Andreas Schildbach
1e66b9a8e3 Finish moving wallet related classes to .wallet package.
These classes are moved to .wallet:
- Wallet + WalletTest
- WalletExtension + WalletExtensionsTest
- WalletProtobufSerializer
- UnreadableWalletException

These classes are moved to .wallet.listeners:
- WalletEventListener
- WalletChangeEventListener
- WalletCoinsReceivedEventListener
- WalletCoinsSentEventListener
- WalletReorganizeEventListener
- ScriptsChangeEventListener
- AbstractWalletEventListener
- KeyChainEventListener
- AbstractKeyChainEventListener
2016-04-01 21:44:30 +02:00
Andreas Schildbach
c1938fec75 Harmonize license headers. 2016-03-26 19:55:05 +01:00
Andreas Schildbach
85f7c39aa5 Refresh bundled checkpoints and switch to textual format for easier audit. 2016-03-21 21:40:14 +01:00
Andreas Schildbach
9e52e4e0bf wallet-template: When constructing the wallet file name from the app's name, replace problematic characters so the filesystem doesn't throw up. 2016-02-29 16:41:49 +01:00
Ross Nicoll
aca39ee9de Split wallet events into single method interfaces 2016-02-06 20:01:38 +01:00
Kirill Vlasov
e3e8e8079d Constructors should only call non-overridable methods 2016-01-06 14:11:00 +01:00
Mike Hearn
9ba1be762a Wallet: flip argument ordering in deprecated Wallet.addEventListener to restore compatibility with 0.13 2015-10-05 17:12:55 +02:00
Andreas Schildbach
d4c7ce5c77 wallet-template: Fix warning about missing @Nullable annotation. 2015-08-24 18:54:00 +02:00
Andreas Schildbach
200f2368c6 AddressFormatException: Make unchecked. Base58 strings are rarely typed manually these days. 2015-08-08 16:33:29 +02:00
Ross Nicoll
ecbd021167 Refactor listener interfaces.
Refactor listener interfaces into their own package.
Split listener interfaces into smaller interfaces.
Make abstract implementations actually abstract.
Rearrange methods for adding listeners to put executor first.
2015-08-08 15:37:46 +02:00
Andreas Schildbach
0441b38599 Provide a consistent fromBase58/toBase58 API for the VersionChecksummedBytes hierarchy.
Deprecates the old constructors and migrates bitcoinj itself to use the new API. Also makes DumpedPrivateKey use WrongNetworkException when appropriate. Adds missing testcases and corrects/adds a bit of JavaDoc.
2015-07-18 13:53:59 +02:00
Amichai Rothman
820765753c Clean up toString and other string-related code. 2015-06-30 12:45:59 +02:00
Mike Hearn
db86185972 WalletTemplate: remove bit of redundant fxml 2015-04-09 17:00:55 +02:00
Mike Hearn
cd337504b7 WalletTemplate: expose MainWindow in Main 2015-04-09 17:00:05 +02:00
Mike Hearn
04bc624a91 Rewrite TxConfidenceTable to actually track confidence objects. Make Transaction.getConfidence() fetch the object from the table via the context. This allows us to simplify large chunks of code quite considerably. Note that confidence listeners are not yet pinning the attached confidence to the root set, so the same old bugs remain if you don't pin the tx object. That will be fixed next. 2015-03-21 17:07:44 +01:00
Mike Hearn
e0870efd61 Rewrite how WalletTemplate estimates scrypt difficulty, as the old approach was horribly busted and could use tons of RAM. Backport from Lighthouse. 2015-02-25 18:58:15 +01:00
Mike Hearn
99ff22d77b Fix a bug in SendMoneyController that caused it to forget the amount of money requested across password requests. Fixes #316. 2015-02-25 18:49:25 +01:00