mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-07-30 19:41:24 +00:00
Fix typos/spelling issues in comments.
This commit is contained in:
committed by
Andreas Schildbach
parent
0c96402fc0
commit
6b79d5e43b
@@ -36,7 +36,7 @@ public class AddressMessage extends Message {
|
||||
private List<PeerAddress> addresses;
|
||||
|
||||
/**
|
||||
* Contruct a new 'addr' message.
|
||||
* Construct a new 'addr' message.
|
||||
* @param params NetworkParameters object.
|
||||
* @param offset The location of the first payload byte within the array.
|
||||
* @param serializer the serializer to use for this block.
|
||||
@@ -49,7 +49,7 @@ public class AddressMessage extends Message {
|
||||
}
|
||||
|
||||
/**
|
||||
* Contruct a new 'addr' message.
|
||||
* Construct a new 'addr' message.
|
||||
* @param params NetworkParameters object.
|
||||
* @param serializer the serializer to use for this block.
|
||||
* @param length The length of message if known. Usually this is provided when deserializing of the wire
|
||||
|
@@ -78,7 +78,7 @@ public class BitcoinSerializer extends MessageSerializer {
|
||||
/**
|
||||
* Constructs a BitcoinSerializer with the given behavior.
|
||||
*
|
||||
* @param params networkParams used to create Messages instances and termining packetMagic
|
||||
* @param params networkParams used to create Messages instances and determining packetMagic
|
||||
* @param parseRetain retain the backing byte array of a message for fast reserialization.
|
||||
*/
|
||||
public BitcoinSerializer(NetworkParameters params, boolean parseRetain) {
|
||||
|
@@ -539,7 +539,7 @@ public class Block extends Message {
|
||||
// ridiculously easy difficulty and this function would accept them.
|
||||
//
|
||||
// To prevent this attack from being possible, elsewhere we check that the difficultyTarget
|
||||
// field is of the right value. This requires us to have the preceeding blocks.
|
||||
// field is of the right value. This requires us to have the preceding blocks.
|
||||
BigInteger target = getDifficultyTargetAsInteger();
|
||||
|
||||
BigInteger h = getHash().toBigInteger();
|
||||
@@ -599,7 +599,7 @@ public class Block extends Message {
|
||||
// entry is a hash.
|
||||
//
|
||||
// The hashing algorithm is double SHA-256. The leaves are a hash of the serialized contents of the transaction.
|
||||
// The interior nodes are hashes of the concenation of the two child hashes.
|
||||
// The interior nodes are hashes of the concatenation of the two child hashes.
|
||||
//
|
||||
// This structure allows the creation of proof that a transaction was included into a block without having to
|
||||
// provide the full block contents. Instead, you can provide only a Merkle branch. For example to prove tx2 was
|
||||
@@ -693,7 +693,7 @@ public class Block extends Message {
|
||||
// Now we need to check that the body of the block actually matches the headers. The network won't generate
|
||||
// an invalid block, but if we didn't validate this then an untrusted man-in-the-middle could obtain the next
|
||||
// valid block from the network and simply replace the transactions in it with their own fictional
|
||||
// transactions that reference spent or non-existant inputs.
|
||||
// transactions that reference spent or non-existent inputs.
|
||||
if (transactions.isEmpty())
|
||||
throw new VerificationException("Block had no transactions");
|
||||
if (this.getOptimalEncodingMessageSize() > MAX_BLOCK_SIZE)
|
||||
|
@@ -70,8 +70,8 @@ public class FilteredBlock extends Message {
|
||||
|
||||
/**
|
||||
* Gets a list of leaf hashes which are contained in the partial merkle tree in this filtered block
|
||||
*
|
||||
* @throws ProtocolException If the partial merkle block is invalid or the merkle root of the partial merkle block doesnt match the block header
|
||||
*
|
||||
* @throws ProtocolException If the partial merkle block is invalid or the merkle root of the partial merkle block doesn't match the block header
|
||||
*/
|
||||
public List<Sha256Hash> getTransactionHashes() throws VerificationException {
|
||||
if (cachedTransactionHashes != null)
|
||||
|
@@ -288,7 +288,7 @@ public abstract class NetworkParameters {
|
||||
/**
|
||||
* <p>Genesis block for this chain.</p>
|
||||
*
|
||||
* <p>The first block in every chain is a well known constant shared between all Bitcoin implemenetations. For a
|
||||
* <p>The first block in every chain is a well known constant shared between all Bitcoin implementations. For a
|
||||
* block to be valid, it must be eventually possible to work backwards to the genesis block by following the
|
||||
* prevBlockHash pointers in the block headers.</p>
|
||||
*
|
||||
@@ -405,7 +405,7 @@ public abstract class NetworkParameters {
|
||||
|
||||
/**
|
||||
* Returns whether this network has a maximum number of coins (finite supply) or
|
||||
* not. Always returns true for Bitcoin, but exists to be overriden for other
|
||||
* not. Always returns true for Bitcoin, but exists to be overridden for other
|
||||
* networks.
|
||||
*/
|
||||
public abstract boolean hasMaxMoney();
|
||||
|
@@ -195,7 +195,7 @@ public class Peer extends PeerSocketHandler {
|
||||
|
||||
/**
|
||||
* <p>Construct a peer that reads/writes from the given block chain. Transactions stored in a {@link TxConfidenceTable}
|
||||
* will have their confidence levels updated when a peer announces it, to reflect the greater likelyhood that
|
||||
* will have their confidence levels updated when a peer announces it, to reflect the greater likelihood that
|
||||
* the transaction is valid.</p>
|
||||
*
|
||||
* <p>Note that this does <b>NOT</b> make a connection to the given remoteAddress, it only creates a handler for a
|
||||
@@ -214,7 +214,7 @@ public class Peer extends PeerSocketHandler {
|
||||
|
||||
/**
|
||||
* <p>Construct a peer that reads/writes from the given block chain. Transactions stored in a {@link TxConfidenceTable}
|
||||
* will have their confidence levels updated when a peer announces it, to reflect the greater likelyhood that
|
||||
* will have their confidence levels updated when a peer announces it, to reflect the greater likelihood that
|
||||
* the transaction is valid.</p>
|
||||
*
|
||||
* <p>Note that this does <b>NOT</b> make a connection to the given remoteAddress, it only creates a handler for a
|
||||
@@ -1263,7 +1263,7 @@ public class Peer extends PeerSocketHandler {
|
||||
// previous one: whilst the stopHash is the same (because we use the orphan root), the start hash
|
||||
// will be different and so the getblocks req won't be dropped as a duplicate. We'll end up
|
||||
// requesting a subset of what we already requested, which can lead to parallel chain downloads
|
||||
// and other nastyness. So we just do a quick removal of redundant getdatas here too.
|
||||
// and other nastiness. So we just do a quick removal of redundant getdatas here too.
|
||||
//
|
||||
// Note that as of June 2012 Bitcoin Core won't actually ever interleave blocks pushed as
|
||||
// part of chain download with newly announced blocks, so it should always be taken care of by
|
||||
|
@@ -20,7 +20,7 @@ package org.bitcoinj.core;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Contains minimal data neccessary to disconnect/connect the transactions
|
||||
* Contains minimal data necessary to disconnect/connect the transactions
|
||||
* in the stored block at will. Can either store the full set of
|
||||
* transactions (if the inputs for the block have not been tested to work)
|
||||
* or the set of transaction outputs created/destroyed when the block is
|
||||
|
@@ -22,7 +22,7 @@ import javax.annotation.*;
|
||||
|
||||
/**
|
||||
* <p>Implementors can listen to events like blocks being downloaded/transactions being broadcast/connect/disconnects,
|
||||
* they can pre-filter messages before they are procesesed by a {@link Peer} or {@link PeerGroup}, and they can
|
||||
* they can pre-filter messages before they are processed by a {@link Peer} or {@link PeerGroup}, and they can
|
||||
* provide transactions to remote peers when they ask for them.</p>
|
||||
*/
|
||||
public interface BlocksDownloadedEventListener {
|
||||
|
@@ -20,7 +20,7 @@ import org.bitcoinj.core.*;
|
||||
|
||||
/**
|
||||
* <p>Implementors can listen to events like blocks being downloaded/transactions being broadcast/connect/disconnects,
|
||||
* they can pre-filter messages before they are procesesed by a {@link Peer} or {@link PeerGroup}, and they can
|
||||
* they can pre-filter messages before they are processed by a {@link Peer} or {@link PeerGroup}, and they can
|
||||
* provide transactions to remote peers when they ask for them.</p>
|
||||
*/
|
||||
public interface ChainDownloadStartedEventListener {
|
||||
|
@@ -24,7 +24,7 @@ import java.util.*;
|
||||
|
||||
/**
|
||||
* <p>Implementors can listen to events like blocks being downloaded/transactions being broadcast/connect/disconnects,
|
||||
* they can pre-filter messages before they are procesesed by a {@link Peer} or {@link PeerGroup}, and they can
|
||||
* they can pre-filter messages before they are processed by a {@link Peer} or {@link PeerGroup}, and they can
|
||||
* provide transactions to remote peers when they ask for them.</p>
|
||||
*/
|
||||
public interface GetDataEventListener {
|
||||
|
@@ -21,7 +21,7 @@ import org.bitcoinj.utils.Threading;
|
||||
|
||||
/**
|
||||
* <p>Implementors can listen to events like blocks being downloaded/transactions being broadcast/connect/disconnects,
|
||||
* they can pre-filter messages before they are procesesed by a {@link Peer} or {@link PeerGroup}, and they can
|
||||
* they can pre-filter messages before they are processed by a {@link Peer} or {@link PeerGroup}, and they can
|
||||
* provide transactions to remote peers when they ask for them.</p>
|
||||
*/
|
||||
public interface PreMessageReceivedEventListener {
|
||||
|
@@ -63,7 +63,7 @@ public class BlockingClient implements MessageWriteTarget {
|
||||
@Nullable final Set<BlockingClient> clientSet) throws IOException {
|
||||
connectFuture = SettableFuture.create();
|
||||
// Try to fit at least one message in the network buffer, but place an upper and lower limit on its size to make
|
||||
// sure it doesnt get too large or have to call read too often.
|
||||
// sure it doesn't get too large or have to call read too often.
|
||||
connection.setWriteTarget(this);
|
||||
socket = socketFactory.createSocket();
|
||||
final Context context = Context.get();
|
||||
|
@@ -22,7 +22,7 @@ import java.nio.ByteBuffer;
|
||||
* A generic handler which is used in {@link NioServer}, {@link NioClient} and {@link BlockingClient} to handle incoming
|
||||
* data streams.
|
||||
*
|
||||
* Used to be callet StreamParser.
|
||||
* Used to be called StreamParser.
|
||||
*/
|
||||
public interface StreamConnection {
|
||||
/** Called when the connection socket is closed */
|
||||
@@ -41,7 +41,7 @@ public interface StreamConnection {
|
||||
* will start reading at (always 0)</li>
|
||||
* <li>May read more than one message (recursively) if there are enough bytes available</li>
|
||||
* <li>Uses some internal buffering to store message which are larger (incl their length prefix) than buff's
|
||||
* capacity(), ie it is up to this method to ensure we dont run out of buffer space to decode the next message.
|
||||
* capacity(), ie it is up to this method to ensure we don't run out of buffer space to decode the next message.
|
||||
* </li>
|
||||
* <li>buff will end with its limit the same as it was previously, and its position set to the position up to which
|
||||
* bytes have been read (the same as its return value)</li>
|
||||
|
@@ -60,8 +60,8 @@ import java.util.Locale;
|
||||
public final class BtcAutoFormat extends BtcFormat {
|
||||
|
||||
/**
|
||||
* Enum for specifying the style of currency indicators thas are used
|
||||
* when formatting, ether codes or symbols.
|
||||
* Enum for specifying the style of currency indicators that are used
|
||||
* when formatting, either codes or symbols.
|
||||
*/
|
||||
public enum Style {
|
||||
|
||||
@@ -83,9 +83,9 @@ public final class BtcAutoFormat extends BtcFormat {
|
||||
@Override void apply(DecimalFormat decimalFormat) {
|
||||
/* To switch to using codes from symbols, we replace each single occurrence of the
|
||||
* currency-sign character with two such characters in a row.
|
||||
* We also insert a space character between every occurence of this character and an
|
||||
* adjacent numerical digit or negative sign (that is, between the currency-sign and
|
||||
* the signed-number). */
|
||||
* We also insert a space character between every occurrence of this character and
|
||||
* an adjacent numerical digit or negative sign (that is, between the currency-sign
|
||||
* and the signed-number). */
|
||||
decimalFormat.applyPattern(
|
||||
negify(decimalFormat.toPattern()).replaceAll("¤","¤¤").
|
||||
replaceAll("([#0.,E-])¤¤","$1 ¤¤").
|
||||
|
@@ -70,7 +70,7 @@ public final class BtcFixedFormat extends BtcFormat {
|
||||
public static final int[] REPEATING_TRIPLETS = {3,3,3,3,3};
|
||||
|
||||
/** The number of places the decimal point of formatted values is shifted rightward from
|
||||
* thet same value expressed in bitcoins. */
|
||||
* the same value expressed in bitcoins. */
|
||||
private final int scale;
|
||||
|
||||
/** Constructor */
|
||||
|
@@ -533,7 +533,7 @@ public abstract class BtcFormat extends Format {
|
||||
* <p>This class constructs new instances of {@link BtcFormat}, allowing for the
|
||||
* configuration of those instances before they are constructed. After obtaining a
|
||||
* {@code Builder} object from the {@link BtcFormat#builder()} method, invoke the
|
||||
* necessary setter methods to obtain your desired configuration. Finaly, the {@link
|
||||
* necessary setter methods to obtain your desired configuration. Finally, the {@link
|
||||
* #build()} method returns a new {@code BtcFormat} object that has the specified
|
||||
* configuration.
|
||||
*
|
||||
@@ -914,7 +914,7 @@ public abstract class BtcFormat extends Format {
|
||||
* according to the given locale.
|
||||
*
|
||||
* <p>The third parameter is the number of fractional decimal places to use for each
|
||||
* formatted number, reduced as neccesary when formatting to avoid giving a place to
|
||||
* formatted number, reduced as necessary when formatting to avoid giving a place to
|
||||
* fractional satoshis.
|
||||
*/
|
||||
public static BtcFormat getInstance(Style style, Locale locale, int fractionPlaces) {
|
||||
@@ -1050,7 +1050,7 @@ public abstract class BtcFormat extends Format {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a new fixeed-denomination formatter with the specified fractional decimal
|
||||
* Return a new fixed-denomination formatter with the specified fractional decimal
|
||||
* placing. The first argument specifies the denomination as the size of the
|
||||
* shift from coin-denomination in increasingly-precise decimal places. The returned object will format
|
||||
* and parse values according to the default locale, and will format the fractional part of
|
||||
@@ -1064,7 +1064,7 @@ public abstract class BtcFormat extends Format {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a new fixeed-denomination formatter. The argument specifies the denomination as
|
||||
* Return a new fixed-denomination formatter. The argument specifies the denomination as
|
||||
* the size of the shift from coin-denomination in increasingly-precise decimal places.
|
||||
* The returned object will format and parse values according to the default locale, and
|
||||
* will format the fractional part of numbers with two decimal places, or fewer as
|
||||
@@ -1075,7 +1075,7 @@ public abstract class BtcFormat extends Format {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a new fixeed-denomination formatter for the given locale. The first argument
|
||||
* Return a new fixed-denomination formatter for the given locale. The first argument
|
||||
* specifies the denomination as the size of the shift from coin-denomination in
|
||||
* increasingly-precise decimal places. The returned object will format and parse values
|
||||
* according to the locale specified by the second argument, and will format the fractional
|
||||
@@ -1247,7 +1247,7 @@ public abstract class BtcFormat extends Format {
|
||||
}
|
||||
|
||||
/** Return the number of fractional decimal places to be displayed when formatting
|
||||
* the given number of monetory units of the denomination indicated by the given decimal scale value,
|
||||
* the given number of monetary units of the denomination indicated by the given decimal scale value,
|
||||
* where 0 = coin, 3 = millicoin, and so on.
|
||||
*
|
||||
* @param unitCount the number of monetary units to be formatted
|
||||
@@ -1526,7 +1526,7 @@ public abstract class BtcFormat extends Format {
|
||||
public static Locale[] getAvailableLocales() { return NumberFormat.getAvailableLocales(); }
|
||||
|
||||
/** Return the unprefixed currency symbol for bitcoins configured for this object. The
|
||||
* return value of this method is constant throughough the life of an instance. */
|
||||
* return value of this method is constant throughout the life of an instance. */
|
||||
public String coinSymbol() { synchronized(numberFormat) {
|
||||
return numberFormat.getDecimalFormatSymbols().getCurrencySymbol();
|
||||
}}
|
||||
|
@@ -44,7 +44,7 @@ import static com.google.common.base.Preconditions.*;
|
||||
public class BasicKeyChain implements EncryptableKeyChain {
|
||||
private final ReentrantLock lock = Threading.lock("BasicKeyChain");
|
||||
|
||||
// Maps used to let us quickly look up a key given data we find in transcations or the block chain.
|
||||
// Maps used to let us quickly look up a key given data we find in transactions or the block chain.
|
||||
private final LinkedHashMap<ByteString, ECKey> hashToKeys;
|
||||
private final LinkedHashMap<ByteString, ECKey> pubkeyToKeys;
|
||||
@Nullable private final KeyCrypter keyCrypter;
|
||||
|
@@ -341,7 +341,7 @@ public abstract class AbstractFullPrunedBlockChainTest {
|
||||
totalPendingTxAmount = totalPendingTxAmount.add(tx.getValueSentToMe(wallet));
|
||||
}
|
||||
|
||||
// The availbale balance should be the 0 (as we spent the 1 BTC that's pending) and estimated should be 1/2 - fee BTC
|
||||
// The available balance should be the 0 (as we spent the 1 BTC that's pending) and estimated should be 1/2 - fee BTC
|
||||
assertEquals("Available balance is incorrect", Coin.ZERO, wallet.getBalance(Wallet.BalanceType.AVAILABLE));
|
||||
assertEquals("Estimated balance is incorrect", amount2.subtract(fee), wallet.getBalance(Wallet.BalanceType.ESTIMATED));
|
||||
assertEquals("Pending tx amount is incorrect", amount2.subtract(fee), totalPendingTxAmount);
|
||||
|
File diff suppressed because one or more lines are too long
@@ -321,7 +321,7 @@ public class FullBlockTestGenerator {
|
||||
|
||||
NewBlock b13 = createNextBlock(b12, chainHeadHeight + 5, out4, null);
|
||||
blocks.add(new BlockAndValidity(b13, false, false, b6.getHash(), chainHeadHeight + 4, "b13"));
|
||||
// Make sure we dont die if an orphan gets added twice
|
||||
// Make sure we don't die if an orphan gets added twice
|
||||
blocks.add(new BlockAndValidity(b13, false, false, b6.getHash(), chainHeadHeight + 4, "b13"));
|
||||
spendableOutputs.offer(b13.getCoinbaseOutput());
|
||||
|
||||
@@ -332,7 +332,7 @@ public class FullBlockTestGenerator {
|
||||
// and will be discarded when an attempt is made to reorg to it.
|
||||
// TODO: Use a WeakReference to check that it is freed properly after the reorg
|
||||
blocks.add(new BlockAndValidity(b14, false, false, b6.getHash(), chainHeadHeight + 4, "b14"));
|
||||
// Make sure we dont die if an orphan gets added twice
|
||||
// Make sure we don't die if an orphan gets added twice
|
||||
blocks.add(new BlockAndValidity(b14, false, false, b6.getHash(), chainHeadHeight + 4, "b14"));
|
||||
|
||||
blocks.add(new BlockAndValidity(b12, false, true, b13.getHash(), chainHeadHeight + 5, "b12"));
|
||||
|
@@ -120,7 +120,7 @@ public class ChannelConnectionTest extends TestWithWallet {
|
||||
serverWallet = new Wallet(UNITTEST);
|
||||
serverWallet.addExtension(new StoredPaymentChannelServerStates(serverWallet, failBroadcaster));
|
||||
serverWallet.freshReceiveKey();
|
||||
// Use an atomic boolean to indicate failure because fail()/assert*() dont work in network threads
|
||||
// Use an atomic boolean to indicate failure because fail()/assert*() don't work in network threads
|
||||
fail = new AtomicBoolean(false);
|
||||
|
||||
// Set up a way to monitor broadcast transactions. When you expect a broadcast, you must release a permit
|
||||
|
@@ -1478,7 +1478,7 @@ public class WalletTest extends TestWithWallet {
|
||||
assertEquals(tx2, transactions.get(0));
|
||||
assertEquals(tx1, transactions.get(1));
|
||||
assertEquals(2, transactions.size());
|
||||
// Check we get only the last transaction if we request a subrage.
|
||||
// Check we get only the last transaction if we request a subrange.
|
||||
transactions = wallet.getRecentTransactions(1, false);
|
||||
assertEquals(1, transactions.size());
|
||||
assertEquals(tx2, transactions.get(0));
|
||||
@@ -2498,7 +2498,7 @@ public class WalletTest extends TestWithWallet {
|
||||
assertEquals(COIN, request20.tx.getInput(0).getValue());
|
||||
assertEquals(CENT, request20.tx.getInput(1).getValue());
|
||||
|
||||
// Same as request 19, but make the change 0 (so it doesnt force fee) and make us require min fee
|
||||
// Same as request 19, but make the change 0 (so it doesn't force fee) and make us require min fee
|
||||
SendRequest request21 = SendRequest.to(OTHER_ADDRESS, CENT);
|
||||
request21.feePerKb = ZERO;
|
||||
request21.ensureMinRequiredFee = true;
|
||||
|
Reference in New Issue
Block a user