From 7369c398ff16c639ae22859bd76b5def5ebca044 Mon Sep 17 00:00:00 2001 From: Mike Hearn Date: Fri, 3 Feb 2012 15:42:30 +0100 Subject: [PATCH] Improve a comment and make Wallet.receivePending() public. --- src/com/google/bitcoin/core/TransactionConfidence.java | 10 ++++++---- src/com/google/bitcoin/core/Wallet.java | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/com/google/bitcoin/core/TransactionConfidence.java b/src/com/google/bitcoin/core/TransactionConfidence.java index d535805f..1cad82d5 100644 --- a/src/com/google/bitcoin/core/TransactionConfidence.java +++ b/src/com/google/bitcoin/core/TransactionConfidence.java @@ -98,10 +98,12 @@ public class TransactionConfidence implements Serializable { BUILDING(1), /** - * If NOT_SEEN_IN_CHAIN, then the transaction is pending and should be included shortly. You can estimate how - * likely the transaction is to be included by connecting to a bunch of nodes then measuring how many announce - * it, using {@link com.google.bitcoin.core.TransactionConfidence#numBroadcastPeers()}. Or if you saw it from - * a trusted peer, you can assume it's valid and will get mined sooner or later as well. + * If NOT_SEEN_IN_CHAIN, then the transaction is pending and should be included shortly, as long as it is being + * announced and is considered valid by the network. A pending transaction will be announced if the containing + * wallet has been attached to a live {@link PeerGroup} using {@link PeerGroup#addWallet(Wallet)}. + * You can estimate how likely the transaction is to be included by connecting to a bunch of nodes then measuring + * how many announce it, using {@link com.google.bitcoin.core.TransactionConfidence#numBroadcastPeers()}. + * Or if you saw it from a trusted peer, you can assume it's valid and will get mined sooner or later as well. */ NOT_SEEN_IN_CHAIN(2), diff --git a/src/com/google/bitcoin/core/Wallet.java b/src/com/google/bitcoin/core/Wallet.java index 81db2fc3..2370850e 100644 --- a/src/com/google/bitcoin/core/Wallet.java +++ b/src/com/google/bitcoin/core/Wallet.java @@ -305,8 +305,8 @@ public class Wallet implements Serializable { * @throws VerificationException * @throws ScriptException */ - synchronized void receivePending(Transaction tx) throws VerificationException, ScriptException { - // Runs in a peer thread. + public synchronized void receivePending(Transaction tx) throws VerificationException, ScriptException { + // Can run in a peer thread. // Ignore it if we already know about this transaction. Receiving a pending transaction never moves it // between pools.