Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/dashpay/dashj into featur…
Browse files Browse the repository at this point in the history
…e-coinjoin
  • Loading branch information
HashEngineering committed Dec 27, 2023
2 parents 3ab8b1e + e7a22e1 commit bd7d61d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ apply plugin: 'maven-publish'
apply plugin: 'jacoco'
apply plugin: 'signing'

version = '20.0.1-CJ-SNAPSHOT'
version = '20.0.2-CJ-SNAPSHOT'
archivesBaseName = 'dashj-core'
eclipse.project.name = 'dashj-core'

Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/org/bitcoinj/core/VersionMessage.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
public class VersionMessage extends Message {

/** The version of this library release, as a string. */
public static final String BITCOINJ_VERSION = "20.0.1-CJ-SNAPSHOT";
public static final String BITCOINJ_VERSION = "20.0.2-CJ-SNAPSHOT";
/** The value that is prepended to the subVer field of this application. */
public static final String LIBRARY_SUBVER = "/DashJ:" + BITCOINJ_VERSION + "/";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
import java.net.InetSocketAddress;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.HashSet;
Expand Down Expand Up @@ -887,14 +888,18 @@ public boolean removeAuthenticationKeyUsageEventListener(AuthenticationKeyUsageE

public void reset() {
keyUsage.clear();
}

public void rescanWallet() {
if (wallet != null) {
Set<Transaction> transactionSet = wallet.getTransactions(false);
List<Transaction> transactionList = Lists.newArrayList(transactionSet);
transactionList.sort((transaction1, transaction2) -> (int) (transaction1.getUpdateTime().getTime() - transaction2.getUpdateTime().getTime()));
keyUsage.clear();
Set<Transaction> transactionSet = wallet.getTransactions(false);
List<Transaction> transactionList = Lists.newArrayList(transactionSet);
transactionList.sort(Comparator.comparingLong(transaction -> transaction.getUpdateTime().getTime()));

for (Transaction tx : transactionList) {
for (Transaction tx : transactionList) {
processTransaction(tx, null, AbstractBlockChain.NewBlockType.BEST_CHAIN);
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,9 @@ public void loadWallet() throws IOException, UnreadableWalletException {
// make sure this wallet has an authenticationGroupExtension
assertTrue(wallet.getKeyChainExtensions().containsKey(AuthenticationGroupExtension.EXTENSION_ID));

// check that reset() preserves the usage count
// check that rescanWallet() preserves the usage count
int usageBefore = authenticationGroupExtension.getKeyUsage().size();
authenticationGroupExtension.reset();
authenticationGroupExtension.rescanWallet();
int usageAfter = authenticationGroupExtension.getKeyUsage().size();
assertEquals(usageBefore, usageAfter);
}
Expand Down

0 comments on commit bd7d61d

Please sign in to comment.