diff --git a/core/src/main/java/org/bitcoinj/core/PeerGroup.java b/core/src/main/java/org/bitcoinj/core/PeerGroup.java index e727084a5..b5108e045 100644 --- a/core/src/main/java/org/bitcoinj/core/PeerGroup.java +++ b/core/src/main/java/org/bitcoinj/core/PeerGroup.java @@ -1763,7 +1763,7 @@ public class PeerGroup implements TransactionBroadcaster { * the min of the wallets earliest key times. * @return a time in seconds since the epoch */ - public Instant getFastCatchupTime() { + public Instant fastCatchupTime() { lock.lock(); try { return fastCatchupTime; @@ -1772,10 +1772,10 @@ public class PeerGroup implements TransactionBroadcaster { } } - /** @deprecated use {@link #getFastCatchupTime()} */ + /** @deprecated use {@link #fastCatchupTime()} */ @Deprecated public long getFastCatchupTimeSecs() { - return getFastCatchupTime().getEpochSecond(); + return fastCatchupTime().getEpochSecond(); } protected void handlePeerDeath(final Peer peer, @Nullable Throwable exception) { diff --git a/integration-test/src/test/java/org/bitcoinj/core/PeerGroupTest.java b/integration-test/src/test/java/org/bitcoinj/core/PeerGroupTest.java index 8adffe108..7f66dec94 100644 --- a/integration-test/src/test/java/org/bitcoinj/core/PeerGroupTest.java +++ b/integration-test/src/test/java/org/bitcoinj/core/PeerGroupTest.java @@ -433,21 +433,21 @@ public class PeerGroupTest extends TestWithPeerGroup { final int WEEK = 86400 * 7; final Instant now = TimeUtils.currentTime().truncatedTo(ChronoUnit.SECONDS); peerGroup.start(); - assertTrue(peerGroup.getFastCatchupTime().isAfter(now.minusSeconds(WEEK).minusSeconds(10000))); + assertTrue(peerGroup.fastCatchupTime().isAfter(now.minusSeconds(WEEK).minusSeconds(10000))); Wallet w2 = Wallet.createDeterministic(UNITTEST, ScriptType.P2PKH); ECKey key1 = new ECKey(); key1.setCreationTime(now.minus(1, ChronoUnit.DAYS)); // One day ago. w2.importKey(key1); peerGroup.addWallet(w2); peerGroup.waitForJobQueue(); - assertEquals(peerGroup.getFastCatchupTime(), now.minusSeconds(86400).minusSeconds(WEEK)); + assertEquals(peerGroup.fastCatchupTime(), now.minusSeconds(86400).minusSeconds(WEEK)); // Adding a key to the wallet should update the fast catchup time, but asynchronously and in the background // due to the need to avoid complicated lock inversions. ECKey key2 = new ECKey(); key2.setCreationTime(now.minusSeconds(100000)); w2.importKey(key2); peerGroup.waitForJobQueue(); - assertEquals(peerGroup.getFastCatchupTime(),now.minusSeconds(WEEK).minusSeconds(100000)); + assertEquals(peerGroup.fastCatchupTime(),now.minusSeconds(WEEK).minusSeconds(100000)); } @Test