Skip to content

Commit 57d54d3

Browse files
author
Rene Malmgren
committed
Merge branch 'master' of github.com:dukeh3/bitcoinj
2 parents 4e31ec4 + e048b97 commit 57d54d3

26 files changed

Lines changed: 225 additions & 479 deletions

base/src/main/java/org/bitcoinj/base/utils/Fiat.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public Fiat add(final Fiat value) {
112112

113113
public Fiat subtract(final Fiat value) {
114114
checkArgument(value.currencyCode.equals(currencyCode), () ->
115-
"values to substract must be of same currency: " + value.currencyCode + " vs " + currencyCode);
115+
"values to subtract must be of same currency: " + value.currencyCode + " vs " + currencyCode);
116116
return new Fiat(currencyCode, Math.subtractExact(this.value, value.value));
117117
}
118118

base/src/test/java/org/bitcoinj/base/internal/StopwatchTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ public void setUp() {
3636

3737
@Test
3838
public void toString_() {
39-
stopwatch.toString();
39+
String string = stopwatch.toString();
40+
assertTrue(string.endsWith(" ms"));
4041
}
4142

4243
@Test
@@ -45,7 +46,7 @@ public void stop() {
4546
}
4647

4748
@Test
48-
public void addSubstract() {
49+
public void addSubtract() {
4950
Instant i1 = Instant.now();
5051
Instant i2 = i1.plus(stopwatch.stop());
5152
Instant i3 = i2.minus(stopwatch);

core/src/main/java/org/bitcoinj/core/BloomFilter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ public synchronized boolean applyAndUpdate(Transaction tx) {
358358
for (ScriptChunk chunk : script.chunks()) {
359359
if (!chunk.isPushData())
360360
continue;
361-
if (contains(chunk.data)) {
361+
if (contains(chunk.pushData())) {
362362
boolean isSendingToPubKeys = ScriptPattern.isP2PK(script) || ScriptPattern.isSentToMultisig(script);
363363
if (flag == BloomUpdate.UPDATE_ALL || (flag == BloomUpdate.UPDATE_P2PUBKEY_ONLY && isSendingToPubKeys))
364364
insert(output.getOutPointFor());
@@ -372,7 +372,7 @@ public synchronized boolean applyAndUpdate(Transaction tx) {
372372
return true;
373373
}
374374
for (ScriptChunk chunk : input.getScriptSig().chunks()) {
375-
if (chunk.isPushData() && contains(chunk.data))
375+
if (chunk.isPushData() && contains(chunk.pushData()))
376376
return true;
377377
}
378378
}

core/src/main/java/org/bitcoinj/crypto/ChildNumber.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@
1616

1717
package org.bitcoinj.crypto;
1818

19-
import java.util.List;
2019
import java.util.Locale;
2120

2221
/**
23-
* <p>This is just a wrapper for the i (child number) as per BIP 32 with a boolean getter for the most significant bit
24-
* and a getter for the actual 0-based child number. A {@link List} of these forms a <i>path</i> through a
22+
* This is just a wrapper for the i (child number) as per BIP 32 with a boolean getter for the most significant bit
23+
* and a getter for the actual 0-based child number. A list of these forms a <i>path</i> through a
2524
* {@link DeterministicHierarchy}. This class is immutable.
25+
* <p>
26+
* This is a value-based class; use of identity-sensitive operations (including reference equality (==), identity
27+
* hash code, or synchronization) on instances of {@code ChildNumber} may have unpredictable results and should be avoided.
2628
*/
2729
public class ChildNumber implements Comparable<ChildNumber> {
2830
/**

core/src/main/java/org/bitcoinj/crypto/HDPath.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ public String toString() {
7979
private static final InternalUtils.Splitter SEPARATOR_SPLITTER = s -> Stream.of(s.split(SEPARATOR))
8080
.map(String::trim)
8181
.collect(Collectors.toList());
82-
protected final int[] children;
82+
/**
83+
* Internal representation of {@code HDPath}, use should be limited to {@code HDPath} and its nested subclasses.
84+
* Java doesn't give us an easy way to limit scope accordingly.
85+
*/
86+
final int[] children;
8387

8488
/** Partial path with BIP44 purpose */
8589
public static final HDPartialPath BIP44_PARENT = partial(ChildNumber.PURPOSE_BIP44);

core/src/main/java/org/bitcoinj/jni/NativeBlockChainListener.java

Lines changed: 0 additions & 53 deletions
This file was deleted.

core/src/main/java/org/bitcoinj/jni/NativeFutureCallback.java

Lines changed: 0 additions & 36 deletions
This file was deleted.

core/src/main/java/org/bitcoinj/jni/NativeKeyChainEventListener.java

Lines changed: 0 additions & 36 deletions
This file was deleted.

core/src/main/java/org/bitcoinj/jni/NativeScriptsChangeEventListener.java

Lines changed: 0 additions & 37 deletions
This file was deleted.

core/src/main/java/org/bitcoinj/jni/NativeTransactionConfidenceEventListener.java

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)