diff --git a/examples/src/main/java/org/bitcoinj/examples/DoubleSpend.java b/examples/src/main/java/org/bitcoinj/examples/DoubleSpend.java index 33a701d7691..5fd6f0592bb 100644 --- a/examples/src/main/java/org/bitcoinj/examples/DoubleSpend.java +++ b/examples/src/main/java/org/bitcoinj/examples/DoubleSpend.java @@ -18,7 +18,8 @@ import org.bitcoinj.base.Address; import org.bitcoinj.base.BitcoinNetwork; -import org.bitcoinj.core.*; +import org.bitcoinj.core.Peer; +import org.bitcoinj.core.Transaction; import org.bitcoinj.kits.WalletAppKit; import org.bitcoinj.utils.BriefLogFormatter; import org.bitcoinj.utils.Threading; @@ -26,7 +27,9 @@ import java.io.File; -import static org.bitcoinj.base.Coin.*; +import static org.bitcoinj.base.Coin.CENT; +import static org.bitcoinj.base.Coin.COIN; +import static org.bitcoinj.base.Coin.SATOSHI; /** * This is a little test app that waits for a coin on a local regtest node, then generates two transactions that double diff --git a/examples/src/main/java/org/bitcoinj/examples/DumpWallet.java b/examples/src/main/java/org/bitcoinj/examples/DumpWallet.java index 7219c64e253..b049657b789 100644 --- a/examples/src/main/java/org/bitcoinj/examples/DumpWallet.java +++ b/examples/src/main/java/org/bitcoinj/examples/DumpWallet.java @@ -16,10 +16,10 @@ package org.bitcoinj.examples; -import java.io.File; - import org.bitcoinj.wallet.Wallet; +import java.io.File; + /** * DumpWallet loads a serialized wallet and prints information about what it contains. */ diff --git a/examples/src/main/java/org/bitcoinj/examples/FetchBlock.java b/examples/src/main/java/org/bitcoinj/examples/FetchBlock.java index a0a7ae63e21..5008add8166 100644 --- a/examples/src/main/java/org/bitcoinj/examples/FetchBlock.java +++ b/examples/src/main/java/org/bitcoinj/examples/FetchBlock.java @@ -20,14 +20,18 @@ import org.bitcoinj.base.BitcoinNetwork; import org.bitcoinj.base.Network; import org.bitcoinj.base.Sha256Hash; -import org.bitcoinj.core.*; +import org.bitcoinj.core.Block; +import org.bitcoinj.core.BlockChain; +import org.bitcoinj.core.NetworkParameters; +import org.bitcoinj.core.Peer; +import org.bitcoinj.core.PeerAddress; +import org.bitcoinj.core.PeerGroup; import org.bitcoinj.net.discovery.DnsDiscovery; import org.bitcoinj.store.BlockStore; import org.bitcoinj.store.MemoryBlockStore; import org.bitcoinj.utils.BriefLogFormatter; import picocli.CommandLine; -import java.net.InetAddress; import java.util.concurrent.Callable; import java.util.concurrent.Future; diff --git a/examples/src/main/java/org/bitcoinj/examples/FetchTransactions.java b/examples/src/main/java/org/bitcoinj/examples/FetchTransactions.java index f659edeee01..69ec4d6bc75 100644 --- a/examples/src/main/java/org/bitcoinj/examples/FetchTransactions.java +++ b/examples/src/main/java/org/bitcoinj/examples/FetchTransactions.java @@ -20,12 +20,16 @@ import org.bitcoinj.base.BitcoinNetwork; import org.bitcoinj.base.Network; import org.bitcoinj.base.Sha256Hash; -import org.bitcoinj.core.*; +import org.bitcoinj.core.BlockChain; +import org.bitcoinj.core.NetworkParameters; +import org.bitcoinj.core.Peer; +import org.bitcoinj.core.PeerAddress; +import org.bitcoinj.core.PeerGroup; +import org.bitcoinj.core.Transaction; import org.bitcoinj.store.BlockStore; import org.bitcoinj.store.MemoryBlockStore; import org.bitcoinj.utils.BriefLogFormatter; -import java.net.InetAddress; import java.util.List; import java.util.concurrent.Future; diff --git a/examples/src/main/java/org/bitcoinj/examples/ForwardingService.java b/examples/src/main/java/org/bitcoinj/examples/ForwardingService.java index ebedaf5a500..459c3197eed 100644 --- a/examples/src/main/java/org/bitcoinj/examples/ForwardingService.java +++ b/examples/src/main/java/org/bitcoinj/examples/ForwardingService.java @@ -16,16 +16,15 @@ package org.bitcoinj.examples; -import org.bitcoinj.base.BitcoinNetwork; import org.bitcoinj.base.Address; -import org.bitcoinj.base.Coin; import org.bitcoinj.base.AddressParser; +import org.bitcoinj.base.BitcoinNetwork; +import org.bitcoinj.base.Coin; import org.bitcoinj.core.Context; import org.bitcoinj.core.Transaction; import org.bitcoinj.core.TransactionBroadcast; import org.bitcoinj.kits.WalletAppKit; import org.bitcoinj.utils.BriefLogFormatter; -import org.bitcoinj.wallet.CoinSelection; import org.bitcoinj.wallet.CoinSelector; import org.bitcoinj.wallet.SendRequest; import org.bitcoinj.wallet.Wallet; @@ -36,9 +35,6 @@ import java.util.Objects; import java.util.concurrent.CompletableFuture; -import static java.util.stream.Collectors.collectingAndThen; -import static java.util.stream.Collectors.toList; - /** * ForwardingService demonstrates basic usage of bitcoinj. It creates an SPV Wallet, listens on the network * and when it receives coins, simply sends them onwards to the address given on the command line. diff --git a/examples/src/main/java/org/bitcoinj/examples/GenerateLowSTests.java b/examples/src/main/java/org/bitcoinj/examples/GenerateLowSTests.java index da7fcff82da..be779e47c66 100644 --- a/examples/src/main/java/org/bitcoinj/examples/GenerateLowSTests.java +++ b/examples/src/main/java/org/bitcoinj/examples/GenerateLowSTests.java @@ -17,36 +17,36 @@ package org.bitcoinj.examples; -import java.io.IOException; -import java.math.BigInteger; -import java.security.NoSuchAlgorithmException; -import java.security.SecureRandom; -import java.util.EnumSet; -import java.util.Objects; - import org.bitcoinj.base.BitcoinNetwork; +import org.bitcoinj.base.Coin; import org.bitcoinj.base.Network; import org.bitcoinj.base.ScriptType; import org.bitcoinj.base.internal.ByteUtils; -import org.bitcoinj.base.Coin; -import org.bitcoinj.crypto.ECKey; -import org.bitcoinj.crypto.SignatureDecodeException; import org.bitcoinj.core.Transaction; import org.bitcoinj.core.TransactionInput; import org.bitcoinj.core.TransactionOutput; import org.bitcoinj.core.VerificationException; +import org.bitcoinj.crypto.ECKey; +import org.bitcoinj.crypto.SignatureDecodeException; import org.bitcoinj.crypto.TransactionSignature; import org.bitcoinj.script.Script; import org.bitcoinj.script.ScriptBuilder; import org.bitcoinj.script.ScriptChunk; import org.bitcoinj.script.ScriptException; - -import static org.bitcoinj.script.ScriptOpCodes.getOpCodeName; import org.bitcoinj.signers.LocalTransactionSigner; import org.bitcoinj.signers.TransactionSigner.ProposedTransaction; import org.bitcoinj.wallet.KeyBag; import org.bitcoinj.wallet.RedeemData; +import java.io.IOException; +import java.math.BigInteger; +import java.security.NoSuchAlgorithmException; +import java.security.SecureRandom; +import java.util.EnumSet; +import java.util.Objects; + +import static org.bitcoinj.script.ScriptOpCodes.getOpCodeName; + /** * Test case generator for transactions with low-S and high-S signatures, to * test the LOW_S script validation flag. diff --git a/examples/src/main/java/org/bitcoinj/examples/Kit.java b/examples/src/main/java/org/bitcoinj/examples/Kit.java index 41b8ec85ce2..920d69971fd 100644 --- a/examples/src/main/java/org/bitcoinj/examples/Kit.java +++ b/examples/src/main/java/org/bitcoinj/examples/Kit.java @@ -17,7 +17,7 @@ package org.bitcoinj.examples; import org.bitcoinj.base.BitcoinNetwork; -import org.bitcoinj.core.*; +import org.bitcoinj.core.TransactionConfidence; import org.bitcoinj.kits.WalletAppKit; import java.io.File; diff --git a/examples/src/main/java/org/bitcoinj/examples/PeerMonitor.java b/examples/src/main/java/org/bitcoinj/examples/PeerMonitor.java index 70c2710712a..939fee1cfb2 100644 --- a/examples/src/main/java/org/bitcoinj/examples/PeerMonitor.java +++ b/examples/src/main/java/org/bitcoinj/examples/PeerMonitor.java @@ -18,9 +18,9 @@ package org.bitcoinj.examples; import org.bitcoinj.base.BitcoinNetwork; +import org.bitcoinj.base.Coin; import org.bitcoinj.base.Network; import org.bitcoinj.core.AddressMessage; -import org.bitcoinj.base.Coin; import org.bitcoinj.core.Peer; import org.bitcoinj.core.PeerAddress; import org.bitcoinj.core.PeerGroup; diff --git a/examples/src/main/java/org/bitcoinj/examples/PrintPeers.java b/examples/src/main/java/org/bitcoinj/examples/PrintPeers.java index 6502705492b..e0b398669b1 100644 --- a/examples/src/main/java/org/bitcoinj/examples/PrintPeers.java +++ b/examples/src/main/java/org/bitcoinj/examples/PrintPeers.java @@ -22,9 +22,9 @@ import org.bitcoinj.core.Peer; import org.bitcoinj.core.PeerAddress; import org.bitcoinj.core.VersionMessage; +import org.bitcoinj.net.NioClientManager; import org.bitcoinj.net.discovery.DnsDiscovery; import org.bitcoinj.net.discovery.PeerDiscoveryException; -import org.bitcoinj.net.NioClientManager; import org.bitcoinj.utils.BriefLogFormatter; import java.net.InetAddress; diff --git a/examples/src/main/java/org/bitcoinj/examples/PrivateKeys.java b/examples/src/main/java/org/bitcoinj/examples/PrivateKeys.java index 11a4c4b0954..a1266dfcfc0 100644 --- a/examples/src/main/java/org/bitcoinj/examples/PrivateKeys.java +++ b/examples/src/main/java/org/bitcoinj/examples/PrivateKeys.java @@ -17,22 +17,21 @@ package org.bitcoinj.examples; +import org.bitcoinj.base.Address; +import org.bitcoinj.base.Base58; import org.bitcoinj.base.BitcoinNetwork; import org.bitcoinj.base.Network; import org.bitcoinj.base.ScriptType; -import org.bitcoinj.base.Address; -import org.bitcoinj.base.Base58; import org.bitcoinj.core.BlockChain; -import org.bitcoinj.crypto.DumpedPrivateKey; -import org.bitcoinj.crypto.ECKey; import org.bitcoinj.core.NetworkParameters; import org.bitcoinj.core.PeerAddress; import org.bitcoinj.core.PeerGroup; +import org.bitcoinj.crypto.DumpedPrivateKey; +import org.bitcoinj.crypto.ECKey; import org.bitcoinj.store.MemoryBlockStore; import org.bitcoinj.wallet.Wallet; import java.math.BigInteger; -import java.net.InetAddress; /** * This example shows how to solve the challenge Hal posted here:
diff --git a/examples/src/main/java/org/bitcoinj/examples/RefreshWallet.java b/examples/src/main/java/org/bitcoinj/examples/RefreshWallet.java
index 040e7939c92..e4ba1d55653 100644
--- a/examples/src/main/java/org/bitcoinj/examples/RefreshWallet.java
+++ b/examples/src/main/java/org/bitcoinj/examples/RefreshWallet.java
@@ -20,7 +20,10 @@
import org.bitcoinj.base.BitcoinNetwork;
import org.bitcoinj.base.Coin;
import org.bitcoinj.base.Network;
-import org.bitcoinj.core.*;
+import org.bitcoinj.core.BlockChain;
+import org.bitcoinj.core.NetworkParameters;
+import org.bitcoinj.core.PeerGroup;
+import org.bitcoinj.core.Transaction;
import org.bitcoinj.store.BlockStore;
import org.bitcoinj.store.MemoryBlockStore;
import org.bitcoinj.wallet.Wallet;
diff --git a/examples/src/main/java/org/bitcoinj/examples/RestoreFromSeed.java b/examples/src/main/java/org/bitcoinj/examples/RestoreFromSeed.java
index 23bdf0b532d..c71929dcff5 100644
--- a/examples/src/main/java/org/bitcoinj/examples/RestoreFromSeed.java
+++ b/examples/src/main/java/org/bitcoinj/examples/RestoreFromSeed.java
@@ -19,12 +19,13 @@
import org.bitcoinj.base.BitcoinNetwork;
import org.bitcoinj.base.Network;
import org.bitcoinj.base.ScriptType;
+import org.bitcoinj.core.BlockChain;
+import org.bitcoinj.core.NetworkParameters;
+import org.bitcoinj.core.PeerGroup;
import org.bitcoinj.core.listeners.DownloadProgressTracker;
-import org.bitcoinj.core.*;
import org.bitcoinj.net.discovery.DnsDiscovery;
import org.bitcoinj.store.SPVBlockStore;
import org.bitcoinj.wallet.DeterministicSeed;
-import org.bitcoinj.wallet.KeyChainGroupStructure;
import org.bitcoinj.wallet.Wallet;
import java.io.File;
diff --git a/examples/src/main/java/org/bitcoinj/examples/SendRequest.java b/examples/src/main/java/org/bitcoinj/examples/SendRequest.java
index 16c0fdc4aa0..3b642b1b895 100644
--- a/examples/src/main/java/org/bitcoinj/examples/SendRequest.java
+++ b/examples/src/main/java/org/bitcoinj/examples/SendRequest.java
@@ -19,7 +19,7 @@
import org.bitcoinj.base.Address;
import org.bitcoinj.base.BitcoinNetwork;
import org.bitcoinj.base.Coin;
-import org.bitcoinj.core.*;
+import org.bitcoinj.core.InsufficientMoneyException;
import org.bitcoinj.kits.WalletAppKit;
import org.bitcoinj.wallet.Wallet;
import org.bitcoinj.wallet.Wallet.BalanceType;
diff --git a/integration-test/src/test/java/org/bitcoinj/core/PeerTest.java b/integration-test/src/test/java/org/bitcoinj/core/PeerTest.java
index 4b10c1706d7..c77bc744c15 100644
--- a/integration-test/src/test/java/org/bitcoinj/core/PeerTest.java
+++ b/integration-test/src/test/java/org/bitcoinj/core/PeerTest.java
@@ -29,7 +29,6 @@
import org.bitcoinj.testing.TestWithNetworkConnections;
import org.bitcoinj.utils.Threading;
import org.bitcoinj.wallet.Wallet;
-import org.checkerframework.checker.units.qual.A;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
diff --git a/integration-test/src/test/java/org/bitcoinj/examples/ForwardingServiceTest.java b/integration-test/src/test/java/org/bitcoinj/examples/ForwardingServiceTest.java
index c6974e5c6bd..43bbe307be5 100644
--- a/integration-test/src/test/java/org/bitcoinj/examples/ForwardingServiceTest.java
+++ b/integration-test/src/test/java/org/bitcoinj/examples/ForwardingServiceTest.java
@@ -16,9 +16,9 @@
package org.bitcoinj.examples;
+import org.bitcoinj.base.Address;
import org.bitcoinj.base.BitcoinNetwork;
import org.bitcoinj.base.ScriptType;
-import org.bitcoinj.base.Address;
import org.bitcoinj.core.Context;
import org.bitcoinj.crypto.ECKey;
import org.junit.jupiter.api.BeforeEach;
diff --git a/integration-test/src/test/java/org/bitcoinj/testing/TestWithNetworkConnections.java b/integration-test/src/test/java/org/bitcoinj/testing/TestWithNetworkConnections.java
index 390f0089555..bc01165063a 100644
--- a/integration-test/src/test/java/org/bitcoinj/testing/TestWithNetworkConnections.java
+++ b/integration-test/src/test/java/org/bitcoinj/testing/TestWithNetworkConnections.java
@@ -17,10 +17,10 @@
package org.bitcoinj.testing;
-import org.bitcoinj.base.ScriptType;
import org.bitcoinj.base.Address;
-import org.bitcoinj.core.BlockChain;
import org.bitcoinj.base.Coin;
+import org.bitcoinj.base.ScriptType;
+import org.bitcoinj.core.BlockChain;
import org.bitcoinj.core.Context;
import org.bitcoinj.core.Message;
import org.bitcoinj.core.NetworkParameters;
diff --git a/integration-test/src/test/java/org/bitcoinj/wallet/WalletAccountPathTest.java b/integration-test/src/test/java/org/bitcoinj/wallet/WalletAccountPathTest.java
index 034f4e7bfbd..586aca162a8 100644
--- a/integration-test/src/test/java/org/bitcoinj/wallet/WalletAccountPathTest.java
+++ b/integration-test/src/test/java/org/bitcoinj/wallet/WalletAccountPathTest.java
@@ -16,12 +16,11 @@
package org.bitcoinj.wallet;
+import org.bitcoinj.base.BitcoinNetwork;
import org.bitcoinj.base.Network;
import org.bitcoinj.base.ScriptType;
import org.bitcoinj.core.Context;
-import org.bitcoinj.core.NetworkParameters;
import org.bitcoinj.crypto.HDPath;
-import org.bitcoinj.base.BitcoinNetwork;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.io.TempDir;
import org.junit.jupiter.params.ParameterizedTest;
@@ -33,12 +32,12 @@
import java.time.Instant;
import java.util.stream.Stream;
-import static org.bitcoinj.base.ScriptType.P2PKH;
-import static org.bitcoinj.base.ScriptType.P2WPKH;
import static org.bitcoinj.base.BitcoinNetwork.MAINNET;
import static org.bitcoinj.base.BitcoinNetwork.TESTNET;
-import static org.bitcoinj.wallet.KeyChainGroupStructure.BIP43;
+import static org.bitcoinj.base.ScriptType.P2PKH;
+import static org.bitcoinj.base.ScriptType.P2WPKH;
import static org.bitcoinj.wallet.KeyChainGroupStructure.BIP32;
+import static org.bitcoinj.wallet.KeyChainGroupStructure.BIP43;
import static org.junit.jupiter.api.Assertions.assertEquals;
/**
diff --git a/settings.gradle b/settings.gradle
index 6bb0dc1a522..2341a4f5371 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1,5 +1,4 @@
import org.gradle.util.GradleVersion
-import org.gradle.api.GradleScriptException
// Minimum Gradle version for build
def minGradleVersion = GradleVersion.version("4.4")
diff --git a/tools/src/main/java/org/bitcoinj/tools/BlockImporter.java b/tools/src/main/java/org/bitcoinj/tools/BlockImporter.java
index 87b24d7fa2b..e61b8c51da7 100644
--- a/tools/src/main/java/org/bitcoinj/tools/BlockImporter.java
+++ b/tools/src/main/java/org/bitcoinj/tools/BlockImporter.java
@@ -18,8 +18,19 @@
import org.bitcoinj.base.BitcoinNetwork;
import org.bitcoinj.base.Network;
-import org.bitcoinj.core.*;
-import org.bitcoinj.store.*;
+import org.bitcoinj.core.AbstractBlockChain;
+import org.bitcoinj.core.Block;
+import org.bitcoinj.core.BlockChain;
+import org.bitcoinj.core.FullPrunedBlockChain;
+import org.bitcoinj.core.NetworkParameters;
+import org.bitcoinj.core.PrunedException;
+import org.bitcoinj.core.VerificationException;
+import org.bitcoinj.store.BlockStore;
+import org.bitcoinj.store.BlockStoreException;
+import org.bitcoinj.store.FullPrunedBlockStore;
+import org.bitcoinj.store.MemoryBlockStore;
+import org.bitcoinj.store.MemoryFullPrunedBlockStore;
+import org.bitcoinj.store.SPVBlockStore;
import org.bitcoinj.utils.BlockFileLoader;
import java.io.File;
diff --git a/tools/src/main/java/org/bitcoinj/tools/BuildCheckpoints.java b/tools/src/main/java/org/bitcoinj/tools/BuildCheckpoints.java
index 709308040a2..b1f67bdeb7f 100644
--- a/tools/src/main/java/org/bitcoinj/tools/BuildCheckpoints.java
+++ b/tools/src/main/java/org/bitcoinj/tools/BuildCheckpoints.java
@@ -20,7 +20,14 @@
import org.bitcoinj.base.BitcoinNetwork;
import org.bitcoinj.base.Sha256Hash;
import org.bitcoinj.base.internal.TimeUtils;
-import org.bitcoinj.core.*;
+import org.bitcoinj.core.BlockChain;
+import org.bitcoinj.core.CheckpointManager;
+import org.bitcoinj.core.Context;
+import org.bitcoinj.core.NetworkParameters;
+import org.bitcoinj.core.Peer;
+import org.bitcoinj.core.PeerAddress;
+import org.bitcoinj.core.PeerGroup;
+import org.bitcoinj.core.StoredBlock;
import org.bitcoinj.net.discovery.DnsDiscovery;
import org.bitcoinj.store.BlockStore;
import org.bitcoinj.store.MemoryBlockStore;
diff --git a/tools/src/main/java/org/bitcoinj/tools/PaymentProtocolTool.java b/tools/src/main/java/org/bitcoinj/tools/PaymentProtocolTool.java
index 9e8a60a4d46..3eb2d2fe5a5 100644
--- a/tools/src/main/java/org/bitcoinj/tools/PaymentProtocolTool.java
+++ b/tools/src/main/java/org/bitcoinj/tools/PaymentProtocolTool.java
@@ -18,12 +18,12 @@
import org.bitcoinj.base.internal.TimeUtils;
import org.bitcoinj.crypto.TrustStoreLoader;
+import org.bitcoinj.protobuf.payments.Protos;
import org.bitcoinj.protocols.payments.PaymentProtocol;
import org.bitcoinj.protocols.payments.PaymentProtocolException;
import org.bitcoinj.protocols.payments.PaymentSession;
import org.bitcoinj.uri.BitcoinURI;
import org.bitcoinj.uri.BitcoinURIParseException;
-import org.bitcoinj.protobuf.payments.Protos;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
@@ -33,7 +33,6 @@
import java.security.KeyStoreException;
import java.security.cert.X509Certificate;
import java.time.Instant;
-import java.util.Date;
import java.util.concurrent.ExecutionException;
import static java.lang.String.format;
diff --git a/tools/src/main/java/org/bitcoinj/tools/TestFeeLevel.java b/tools/src/main/java/org/bitcoinj/tools/TestFeeLevel.java
index 4a831fe0956..fa00fce9a09 100644
--- a/tools/src/main/java/org/bitcoinj/tools/TestFeeLevel.java
+++ b/tools/src/main/java/org/bitcoinj/tools/TestFeeLevel.java
@@ -19,9 +19,8 @@
import org.bitcoinj.base.BitcoinNetwork;
import org.bitcoinj.base.Coin;
import org.bitcoinj.base.ScriptType;
-import org.bitcoinj.core.*;
-import org.bitcoinj.core.listeners.PeerConnectedEventListener;
-import org.bitcoinj.core.listeners.PeerDisconnectedEventListener;
+import org.bitcoinj.core.InsufficientMoneyException;
+import org.bitcoinj.core.Transaction;
import org.bitcoinj.kits.WalletAppKit;
import org.bitcoinj.utils.BriefLogFormatter;
import org.bitcoinj.wallet.KeyChainGroupStructure;
diff --git a/tools/src/main/java/org/bitcoinj/tools/WatchMempool.java b/tools/src/main/java/org/bitcoinj/tools/WatchMempool.java
index e0348dc43c6..d9f8660a013 100644
--- a/tools/src/main/java/org/bitcoinj/tools/WatchMempool.java
+++ b/tools/src/main/java/org/bitcoinj/tools/WatchMempool.java
@@ -17,18 +17,9 @@
package org.bitcoinj.tools;
-import java.time.Duration;
-import java.time.Instant;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
import org.bitcoinj.base.BitcoinNetwork;
import org.bitcoinj.base.Network;
import org.bitcoinj.base.internal.TimeUtils;
-import org.bitcoinj.core.listeners.*;
-import org.bitcoinj.core.Peer;
import org.bitcoinj.core.PeerGroup;
import org.bitcoinj.core.Transaction;
import org.bitcoinj.net.discovery.DnsDiscovery;
@@ -38,6 +29,13 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.time.Duration;
+import java.time.Instant;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
public class WatchMempool {
private static final Logger log = LoggerFactory.getLogger(WatchMempool.class);
private static final Network NETWORK = BitcoinNetwork.MAINNET;
diff --git a/wallettemplate/src/main/java/org/bitcoinj/walletfx/application/WalletApplication.java b/wallettemplate/src/main/java/org/bitcoinj/walletfx/application/WalletApplication.java
index 5b64aa59208..b02d3ad42e2 100644
--- a/wallettemplate/src/main/java/org/bitcoinj/walletfx/application/WalletApplication.java
+++ b/wallettemplate/src/main/java/org/bitcoinj/walletfx/application/WalletApplication.java
@@ -17,6 +17,7 @@
package org.bitcoinj.walletfx.application;
import com.google.common.util.concurrent.Service;
+import jakarta.annotation.Nullable;
import javafx.application.Platform;
import javafx.scene.input.KeyCombination;
import javafx.stage.Stage;
@@ -34,7 +35,6 @@
import org.bitcoinj.walletfx.utils.GuiUtils;
import wallettemplate.WalletSetPasswordController;
-import jakarta.annotation.Nullable;
import java.io.File;
import java.io.IOException;
diff --git a/wallettemplate/src/main/java/org/bitcoinj/walletfx/controls/BitcoinAddressValidator.java b/wallettemplate/src/main/java/org/bitcoinj/walletfx/controls/BitcoinAddressValidator.java
index dd5b2bf024c..6b6ee5e09b8 100644
--- a/wallettemplate/src/main/java/org/bitcoinj/walletfx/controls/BitcoinAddressValidator.java
+++ b/wallettemplate/src/main/java/org/bitcoinj/walletfx/controls/BitcoinAddressValidator.java
@@ -16,11 +16,10 @@
package org.bitcoinj.walletfx.controls;
-import org.bitcoinj.base.exceptions.AddressFormatException;
-
import javafx.scene.Node;
import javafx.scene.control.TextField;
import org.bitcoinj.base.AddressParser;
+import org.bitcoinj.base.exceptions.AddressFormatException;
import org.bitcoinj.walletfx.utils.TextFieldValidator;
/**
diff --git a/wallettemplate/src/main/java/org/bitcoinj/walletfx/controls/ClickableBitcoinAddress.java b/wallettemplate/src/main/java/org/bitcoinj/walletfx/controls/ClickableBitcoinAddress.java
index bdff64959a4..9a53d673dfc 100644
--- a/wallettemplate/src/main/java/org/bitcoinj/walletfx/controls/ClickableBitcoinAddress.java
+++ b/wallettemplate/src/main/java/org/bitcoinj/walletfx/controls/ClickableBitcoinAddress.java
@@ -16,10 +16,8 @@
package org.bitcoinj.walletfx.controls;
-import java.awt.Desktop;
-import java.io.IOException;
-import java.net.URI;
-
+import de.jensd.fx.fontawesome.AwesomeDude;
+import de.jensd.fx.fontawesome.AwesomeIcon;
import javafx.beans.binding.StringExpression;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
@@ -38,17 +36,16 @@
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.Pane;
-
import org.bitcoinj.base.Address;
import org.bitcoinj.uri.BitcoinURI;
-
import org.bitcoinj.walletfx.overlay.OverlayController;
import org.bitcoinj.walletfx.overlay.OverlayableStackPaneController;
import org.bitcoinj.walletfx.utils.GuiUtils;
import org.bitcoinj.walletfx.utils.QRCodeImages;
-import de.jensd.fx.fontawesome.AwesomeDude;
-import de.jensd.fx.fontawesome.AwesomeIcon;
+import java.awt.*;
+import java.io.IOException;
+import java.net.URI;
import static javafx.beans.binding.Bindings.convert;
diff --git a/wallettemplate/src/main/java/org/bitcoinj/walletfx/controls/NotificationBarPane.java b/wallettemplate/src/main/java/org/bitcoinj/walletfx/controls/NotificationBarPane.java
index bd3255e7bd0..f4f80418e26 100644
--- a/wallettemplate/src/main/java/org/bitcoinj/walletfx/controls/NotificationBarPane.java
+++ b/wallettemplate/src/main/java/org/bitcoinj/walletfx/controls/NotificationBarPane.java
@@ -16,6 +16,7 @@
package org.bitcoinj.walletfx.controls;
+import jakarta.annotation.Nullable;
import javafx.animation.Interpolator;
import javafx.animation.KeyFrame;
import javafx.animation.KeyValue;
@@ -36,8 +37,6 @@
import org.bitcoinj.walletfx.utils.easing.EasingMode;
import org.bitcoinj.walletfx.utils.easing.ElasticInterpolator;
-import jakarta.annotation.Nullable;
-
/**
* Wraps the given Node in a BorderPane and allows a thin bar to slide in from the bottom or top, squeezing the content
* node. The API allows different "items" to be added/removed and they will be displayed one at a time, fading between
diff --git a/wallettemplate/src/main/java/org/bitcoinj/walletfx/overlay/OverlayableStackPaneController.java b/wallettemplate/src/main/java/org/bitcoinj/walletfx/overlay/OverlayableStackPaneController.java
index 2844495cf50..7ea4bf4167a 100644
--- a/wallettemplate/src/main/java/org/bitcoinj/walletfx/overlay/OverlayableStackPaneController.java
+++ b/wallettemplate/src/main/java/org/bitcoinj/walletfx/overlay/OverlayableStackPaneController.java
@@ -15,14 +15,13 @@
*/
package org.bitcoinj.walletfx.overlay;
+import jakarta.annotation.Nullable;
import javafx.fxml.FXMLLoader;
import javafx.scene.Node;
import javafx.scene.layout.Pane;
import javafx.scene.layout.StackPane;
import org.bitcoinj.walletfx.utils.GuiUtils;
-import jakarta.annotation.Nullable;
-
import java.io.IOException;
import java.net.URL;
diff --git a/wallettemplate/src/main/java/org/bitcoinj/walletfx/utils/BitcoinUIModel.java b/wallettemplate/src/main/java/org/bitcoinj/walletfx/utils/BitcoinUIModel.java
index 86a606e1483..4eae97b6ed1 100644
--- a/wallettemplate/src/main/java/org/bitcoinj/walletfx/utils/BitcoinUIModel.java
+++ b/wallettemplate/src/main/java/org/bitcoinj/walletfx/utils/BitcoinUIModel.java
@@ -16,18 +16,17 @@
package org.bitcoinj.walletfx.utils;
-import org.bitcoinj.base.Address;
-import org.bitcoinj.base.Coin;
-import org.bitcoinj.core.listeners.DownloadProgressTracker;
-import org.bitcoinj.wallet.Wallet;
import javafx.application.Platform;
import javafx.beans.property.ReadOnlyDoubleProperty;
import javafx.beans.property.ReadOnlyObjectProperty;
import javafx.beans.property.SimpleDoubleProperty;
import javafx.beans.property.SimpleObjectProperty;
+import org.bitcoinj.base.Address;
+import org.bitcoinj.base.Coin;
+import org.bitcoinj.core.listeners.DownloadProgressTracker;
+import org.bitcoinj.wallet.Wallet;
import java.time.Instant;
-import java.util.Date;
/**
* A class that exposes relevant bitcoin stuff as JavaFX bindable properties.
diff --git a/wallettemplate/src/main/java/org/bitcoinj/walletfx/utils/GuiUtils.java b/wallettemplate/src/main/java/org/bitcoinj/walletfx/utils/GuiUtils.java
index 4a31d369e0a..e383a1ad65c 100644
--- a/wallettemplate/src/main/java/org/bitcoinj/walletfx/utils/GuiUtils.java
+++ b/wallettemplate/src/main/java/org/bitcoinj/walletfx/utils/GuiUtils.java
@@ -16,7 +16,12 @@
package org.bitcoinj.walletfx.utils;
-import javafx.animation.*;
+import javafx.animation.Animation;
+import javafx.animation.FadeTransition;
+import javafx.animation.KeyFrame;
+import javafx.animation.KeyValue;
+import javafx.animation.ScaleTransition;
+import javafx.animation.Timeline;
import javafx.application.Platform;
import javafx.fxml.FXMLLoader;
import javafx.scene.Node;
diff --git a/wallettemplate/src/main/java/org/bitcoinj/walletfx/utils/KeyDerivationTasks.java b/wallettemplate/src/main/java/org/bitcoinj/walletfx/utils/KeyDerivationTasks.java
index 1231e71518a..c41fa43e970 100644
--- a/wallettemplate/src/main/java/org/bitcoinj/walletfx/utils/KeyDerivationTasks.java
+++ b/wallettemplate/src/main/java/org/bitcoinj/walletfx/utils/KeyDerivationTasks.java
@@ -16,14 +16,14 @@
package org.bitcoinj.walletfx.utils;
-import org.bitcoinj.crypto.AesKey;
-import org.bitcoinj.crypto.KeyCrypterScrypt;
+import jakarta.annotation.Nullable;
import javafx.beans.property.ReadOnlyDoubleProperty;
import javafx.concurrent.Task;
+import org.bitcoinj.crypto.AesKey;
+import org.bitcoinj.crypto.KeyCrypterScrypt;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import jakarta.annotation.Nullable;
import java.time.Duration;
import static org.bitcoinj.walletfx.utils.GuiUtils.checkGuiThread;
diff --git a/wallettemplate/src/main/java/wallettemplate/MainController.java b/wallettemplate/src/main/java/wallettemplate/MainController.java
index fe749380a1c..ed2b26055ce 100644
--- a/wallettemplate/src/main/java/wallettemplate/MainController.java
+++ b/wallettemplate/src/main/java/wallettemplate/MainController.java
@@ -16,30 +16,30 @@
package wallettemplate;
-import javafx.beans.binding.Binding;
-import javafx.beans.binding.Bindings;
-import javafx.beans.value.ObservableValue;
-import javafx.scene.Scene;
-import javafx.scene.input.KeyCombination;
-import javafx.scene.layout.Pane;
-import org.bitcoinj.core.listeners.DownloadProgressTracker;
-import org.bitcoinj.base.Coin;
-import org.bitcoinj.base.utils.MonetaryFormat;
import javafx.animation.FadeTransition;
import javafx.animation.ParallelTransition;
import javafx.animation.TranslateTransition;
+import javafx.beans.binding.Binding;
+import javafx.beans.binding.Bindings;
+import javafx.beans.value.ObservableValue;
import javafx.event.ActionEvent;
+import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
+import javafx.scene.input.KeyCombination;
import javafx.scene.layout.HBox;
+import javafx.scene.layout.Pane;
import javafx.util.Duration;
+import org.bitcoinj.base.Coin;
+import org.bitcoinj.base.utils.MonetaryFormat;
+import org.bitcoinj.core.listeners.DownloadProgressTracker;
import org.bitcoinj.walletfx.application.MainWindowController;
import org.bitcoinj.walletfx.application.WalletApplication;
-import org.bitcoinj.walletfx.utils.GuiUtils;
-import org.bitcoinj.walletfx.utils.TextFieldValidator;
import org.bitcoinj.walletfx.controls.ClickableBitcoinAddress;
import org.bitcoinj.walletfx.controls.NotificationBarPane;
import org.bitcoinj.walletfx.utils.BitcoinUIModel;
+import org.bitcoinj.walletfx.utils.GuiUtils;
+import org.bitcoinj.walletfx.utils.TextFieldValidator;
import org.bitcoinj.walletfx.utils.easing.EasingMode;
import org.bitcoinj.walletfx.utils.easing.ElasticInterpolator;
diff --git a/wallettemplate/src/main/java/wallettemplate/SendMoneyController.java b/wallettemplate/src/main/java/wallettemplate/SendMoneyController.java
index 41648b60ead..1e0a0911247 100644
--- a/wallettemplate/src/main/java/wallettemplate/SendMoneyController.java
+++ b/wallettemplate/src/main/java/wallettemplate/SendMoneyController.java
@@ -17,28 +17,30 @@
package wallettemplate;
import javafx.application.Platform;
+import javafx.event.ActionEvent;
+import javafx.scene.control.Button;
+import javafx.scene.control.Label;
+import javafx.scene.control.TextField;
import javafx.scene.layout.HBox;
import org.bitcoinj.base.Address;
import org.bitcoinj.base.Coin;
+import org.bitcoinj.core.InsufficientMoneyException;
+import org.bitcoinj.core.TransactionConfidence;
import org.bitcoinj.crypto.AesKey;
-import org.bitcoinj.core.*;
import org.bitcoinj.crypto.ECKey;
import org.bitcoinj.wallet.SendRequest;
import org.bitcoinj.wallet.Wallet;
-
-import javafx.event.ActionEvent;
-import javafx.scene.control.Button;
-import javafx.scene.control.Label;
-import javafx.scene.control.TextField;
import org.bitcoinj.walletfx.application.WalletApplication;
+import org.bitcoinj.walletfx.controls.BitcoinAddressValidator;
import org.bitcoinj.walletfx.overlay.OverlayController;
import org.bitcoinj.walletfx.overlay.OverlayableStackPaneController;
-import org.bitcoinj.walletfx.controls.BitcoinAddressValidator;
import org.bitcoinj.walletfx.utils.TextFieldValidator;
import org.bitcoinj.walletfx.utils.WTUtils;
import static org.bitcoinj.base.internal.Preconditions.checkState;
-import static org.bitcoinj.walletfx.utils.GuiUtils.*;
+import static org.bitcoinj.walletfx.utils.GuiUtils.checkGuiThread;
+import static org.bitcoinj.walletfx.utils.GuiUtils.crashAlert;
+import static org.bitcoinj.walletfx.utils.GuiUtils.informationalAlert;
public class SendMoneyController implements OverlayController