diff --git a/core/src/main/java/org/bitcoinj/core/Block.java b/core/src/main/java/org/bitcoinj/core/Block.java index 86ae61b9a..002c17b9b 100644 --- a/core/src/main/java/org/bitcoinj/core/Block.java +++ b/core/src/main/java/org/bitcoinj/core/Block.java @@ -498,6 +498,7 @@ public class Block extends Message { *
This can loop forever if a solution cannot be found solely by incrementing nonce. It doesn't change * extraNonce.
*/ + @VisibleForTesting public void solve() { while (true) { try { @@ -773,6 +774,7 @@ public class Block extends Message { } /** Exists only for unit testing. */ + @VisibleForTesting void setMerkleRoot(Sha256Hash value) { unCacheHeader(); merkleRoot = value; @@ -823,6 +825,7 @@ public class Block extends Message { return prevBlockHash; } + @VisibleForTesting void setPrevBlockHash(Sha256Hash prevBlockHash) { unCacheHeader(); this.prevBlockHash = prevBlockHash; @@ -844,6 +847,7 @@ public class Block extends Message { return new Date(getTimeSeconds()*1000); } + @VisibleForTesting public void setTime(long time) { unCacheHeader(); this.time = time; @@ -864,6 +868,7 @@ public class Block extends Message { } /** Sets the difficulty target in compact form. */ + @VisibleForTesting public void setDifficultyTarget(long compactForm) { unCacheHeader(); this.difficultyTarget = compactForm; @@ -879,6 +884,7 @@ public class Block extends Message { } /** Sets the nonce and clears any cached data. */ + @VisibleForTesting public void setNonce(long nonce) { unCacheHeader(); this.nonce = nonce; @@ -947,6 +953,7 @@ public class Block extends Message { * * @param height block height, if known, or -1 otherwise. */ + @VisibleForTesting Block createNextBlock(@Nullable final Address to, final long version, @Nullable TransactionOutPoint prevOut, final long time, final byte[] pubKey, final Coin coinbaseValue,