diff --git a/core/src/main/java/org/bitcoinj/core/TransactionConfidence.java b/core/src/main/java/org/bitcoinj/core/TransactionConfidence.java index e3e706914d3..6d0a7dec3d2 100644 --- a/core/src/main/java/org/bitcoinj/core/TransactionConfidence.java +++ b/core/src/main/java/org/bitcoinj/core/TransactionConfidence.java @@ -112,12 +112,12 @@ public enum ConfidenceType { * If a transaction hasn't been broadcast yet, or there's no record of it, its confidence is UNKNOWN. */ UNKNOWN(0); - + private int value; ConfidenceType(int value) { this.value = value; } - + public int getValue() { return value; } @@ -262,7 +262,7 @@ public synchronized ConfidenceType getConfidenceType() { } /** - * Called by other objects in the system, like a {@link Wallet}, when new information about the confidence of a + * Called by other objects in the system, like a {@link Wallet}, when new information about the confidence of a * transaction becomes available. */ public synchronized void setConfidenceType(ConfidenceType confidenceType) { @@ -368,11 +368,8 @@ public synchronized String toString() { * * @return the new depth */ - public synchronized int incrementDepthInBlocks(int height) { - if (getAppearedAtChainHeight() != -1) - this.depth = height - getAppearedAtChainHeight() + 1; - - return this.depth; + public synchronized int incrementDepthInBlocks() { + return ++this.depth; } /** @@ -381,7 +378,7 @@ public synchronized int incrementDepthInBlocks(int height) { * considers a transaction impractical to reverse after 6 blocks, but as of EOY 2011 network * security is high enough that often only one block is considered enough even for high value transactions. For low * value transactions like songs, or other cheap items, no blocks at all may be necessary.
- * + * *If the transaction appears in the top block, the depth is one. If it's anything else (pending, dead, unknown) * the depth is zero.
*/ diff --git a/core/src/main/java/org/bitcoinj/wallet/Wallet.java b/core/src/main/java/org/bitcoinj/wallet/Wallet.java index 8e11e4538b0..72c9e24a6dc 100644 --- a/core/src/main/java/org/bitcoinj/wallet/Wallet.java +++ b/core/src/main/java/org/bitcoinj/wallet/Wallet.java @@ -376,7 +376,7 @@ public DeterministicKeyChain getActiveKeyChain() { public DeterministicKeyChain getActiveKeychain() { return keyChainGroup.getActiveKeyChain(); } - + /** *Adds given transaction signer to the list of signers. It will be added to the end of the signers list, so if * this wallet already has some signers added, given signer will be executed after all of them.
@@ -823,7 +823,7 @@ public DeterministicKey getWatchingKey() { /** * Returns whether this wallet consists entirely of watching keys (unencrypted keys with no private part). Mixed * wallets are forbidden. - * + * * @throws IllegalStateException * if there are no keys, or if there is a mix between watching and non-watching keys. */ @@ -1683,6 +1683,11 @@ public void receivePending(Transaction tx, @Nullable ListGets a bloom filter that contains all of the public keys from this wallet, and which will provide the given * false-positive rate if it has size elements. Keep in mind that you will get 2 elements in the bloom filter for * each key in the wallet, for the public key and the hash of the public key (address form).
- * + * *This is used to generate a BloomFilter which can be {@link BloomFilter#merge(BloomFilter)}d with another. * It could also be used if you have a specific target for the filter's size.
- * + * *See the docs for {@link BloomFilter(int, double)} for a brief explanation of anonymity when using bloom * filters.
*/ @@ -4862,7 +4866,7 @@ public FeeCalculation calculateFee(SendRequest req, Coin value, List