Improve a comment and make Wallet.receivePending() public.

This commit is contained in:
Mike Hearn 2012-02-03 15:42:30 +01:00
parent c1cb5c10d5
commit 7369c398ff
2 changed files with 8 additions and 6 deletions

View File

@ -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),

View File

@ -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.