From 8782e0caffdc0f656a084a4685c1d99376e74e79 Mon Sep 17 00:00:00 2001 From: HashEngineering Date: Wed, 27 Nov 2024 01:25:00 -0800 Subject: [PATCH] refactor: add default ctor for DownloadProgressTracker --- .../org/bitcoinj/core/listeners/DownloadProgressTracker.java | 4 ++++ .../src/main/java/org/bitcoinj/examples/CreateChainFile.java | 2 +- .../src/main/java/org/bitcoinj/examples/RestoreFromSeed.java | 2 +- .../java/org/bitcoinj/examples/RestoreFromSeedThenDump.java | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/org/bitcoinj/core/listeners/DownloadProgressTracker.java b/core/src/main/java/org/bitcoinj/core/listeners/DownloadProgressTracker.java index 968c6e97e0..3b05dead43 100644 --- a/core/src/main/java/org/bitcoinj/core/listeners/DownloadProgressTracker.java +++ b/core/src/main/java/org/bitcoinj/core/listeners/DownloadProgressTracker.java @@ -60,6 +60,10 @@ public class DownloadProgressTracker extends AbstractPeerDataEventListener { public double preBlocksWeight = 0.05; public double blocksWeight; + public DownloadProgressTracker() { + this(false); + } + public DownloadProgressTracker(boolean hasPreBlockProcessing) { this.hasPreBlockProcessing = hasPreBlockProcessing; } diff --git a/examples/src/main/java/org/bitcoinj/examples/CreateChainFile.java b/examples/src/main/java/org/bitcoinj/examples/CreateChainFile.java index 45718ed05a..9c42482b71 100644 --- a/examples/src/main/java/org/bitcoinj/examples/CreateChainFile.java +++ b/examples/src/main/java/org/bitcoinj/examples/CreateChainFile.java @@ -102,7 +102,7 @@ public static void main(String[] args) throws Exception { chain.addWallet(wallet); peerGroup.addWallet(wallet); - DownloadProgressTracker bListener = new DownloadProgressTracker(false) { + DownloadProgressTracker bListener = new DownloadProgressTracker() { @Override public void doneDownload() { System.out.println("blockchain downloaded"); diff --git a/examples/src/main/java/org/bitcoinj/examples/RestoreFromSeed.java b/examples/src/main/java/org/bitcoinj/examples/RestoreFromSeed.java index c2ac869450..c4af62aea2 100644 --- a/examples/src/main/java/org/bitcoinj/examples/RestoreFromSeed.java +++ b/examples/src/main/java/org/bitcoinj/examples/RestoreFromSeed.java @@ -68,7 +68,7 @@ public static void main(String[] args) throws Exception { chain.addWallet(wallet); peerGroup.addWallet(wallet); - DownloadProgressTracker bListener = new DownloadProgressTracker(false) { + DownloadProgressTracker bListener = new DownloadProgressTracker() { @Override public void doneDownload() { System.out.println("blockchain downloaded"); diff --git a/examples/src/main/java/org/bitcoinj/examples/RestoreFromSeedThenDump.java b/examples/src/main/java/org/bitcoinj/examples/RestoreFromSeedThenDump.java index 2872399d49..95e053732a 100644 --- a/examples/src/main/java/org/bitcoinj/examples/RestoreFromSeedThenDump.java +++ b/examples/src/main/java/org/bitcoinj/examples/RestoreFromSeedThenDump.java @@ -111,7 +111,7 @@ public static void main(String[] args) throws Exception { chain.addWallet(wallet); peerGroup.addWallet(wallet); - DownloadProgressTracker bListener = new DownloadProgressTracker(false) { + DownloadProgressTracker bListener = new DownloadProgressTracker() { @Override public void doneDownload() { System.out.println("blockchain downloaded");