From dda2316884aff930abf24e6722c518d4bb507412 Mon Sep 17 00:00:00 2001 From: CalDescent Date: Wed, 9 Feb 2022 19:46:10 +0000 Subject: [PATCH] Revert "Try a lookahead size of 20 (instead of 3) when asking Bitcoinj for the balance." This reverts commit d7658ee9f9bc8d7edef9e9189af1d0a129286a67. --- src/main/java/org/qortal/crosschain/Bitcoiny.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/qortal/crosschain/Bitcoiny.java b/src/main/java/org/qortal/crosschain/Bitcoiny.java index bd2e165b..fad05f6d 100644 --- a/src/main/java/org/qortal/crosschain/Bitcoiny.java +++ b/src/main/java/org/qortal/crosschain/Bitcoiny.java @@ -51,14 +51,9 @@ public abstract class Bitcoiny implements ForeignBlockchain { * i.e. keys with transactions but with no unspent outputs. */ protected final Set spentKeys = Collections.synchronizedSet(new HashSet<>()); - /** How many wallet keys to generate in each batch. */ + /** How many bitcoinj wallet keys to generate in each batch. */ private static final int WALLET_KEY_LOOKAHEAD_INCREMENT = 3; - /** How many wallet keys to generate in each batch when using bitcoinj as the data provider. - * We must use a higher value here since we are unable to request multiple batches of keys. - * Without this, the bitcoinj balance (or other data) can be missing transactions. */ - private static final int WALLET_KEY_LOOKAHEAD_INCREMENT_BITCOINJ = 20; - /** Byte offset into raw block headers to block timestamp. */ private static final int TIMESTAMP_OFFSET = 4 + 32 + 32; @@ -554,7 +549,7 @@ public abstract class Bitcoiny implements ForeignBlockchain { this.keyChain = this.wallet.getActiveKeyChain(); // Set up wallet's key chain - this.keyChain.setLookaheadSize(Bitcoiny.WALLET_KEY_LOOKAHEAD_INCREMENT_BITCOINJ); + this.keyChain.setLookaheadSize(Bitcoiny.WALLET_KEY_LOOKAHEAD_INCREMENT); this.keyChain.maybeLookAhead(); }