mirror of
https://github.com/sparrowwallet/drongo.git
synced 2024-12-27 02:26:44 +00:00
fix off by one bug
This commit is contained in:
parent
66d4e11bf6
commit
2e1012da8b
1 changed files with 5 additions and 5 deletions
|
@ -101,18 +101,18 @@ public class Wallet {
|
||||||
purposeNode = optionalPurposeNode.get();
|
purposeNode = optionalPurposeNode.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
purposeNode.fillToIndex(getLookAhead(purposeNode));
|
purposeNode.fillToIndex(getLookAheadIndex(purposeNode));
|
||||||
return purposeNode;
|
return purposeNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getLookAhead(WalletNode node) {
|
public int getLookAheadIndex(WalletNode node) {
|
||||||
int lookAhead = DEFAULT_LOOKAHEAD;
|
int lookAheadIndex = DEFAULT_LOOKAHEAD - 1;
|
||||||
Integer highestUsed = node.getHighestUsedIndex();
|
Integer highestUsed = node.getHighestUsedIndex();
|
||||||
if(highestUsed != null) {
|
if(highestUsed != null) {
|
||||||
lookAhead = highestUsed + lookAhead;
|
lookAheadIndex = highestUsed + DEFAULT_LOOKAHEAD;
|
||||||
}
|
}
|
||||||
|
|
||||||
return lookAhead;
|
return lookAheadIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
public WalletNode getFreshNode(KeyPurpose keyPurpose) {
|
public WalletNode getFreshNode(KeyPurpose keyPurpose) {
|
||||||
|
|
Loading…
Reference in a new issue