Skip to content

Commit

Permalink
Replace documentation references to "Satoshi/official/reference clien…
Browse files Browse the repository at this point in the history
…t/implementation" by "Bitcoin Core".

No code is changed.
  • Loading branch information
schildbach committed Dec 5, 2015
1 parent b031d65 commit 7cb7fec
Show file tree
Hide file tree
Showing 29 changed files with 74 additions and 74 deletions.
4 changes: 2 additions & 2 deletions core/src/main/java/org/bitcoinj/core/AbstractBlockChain.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
* <p>There are two subclasses of AbstractBlockChain that are useful: {@link BlockChain}, which is the simplest
* class and implements <i>simplified payment verification</i>. This is a lightweight and efficient mode that does
* not verify the contents of blocks, just their headers. A {@link FullPrunedBlockChain} paired with a
* {@link org.bitcoinj.store.H2FullPrunedBlockStore} implements full verification, which is equivalent to the
* original Satoshi client. To learn more about the alternative security models, please consult the articles on the
* {@link org.bitcoinj.store.H2FullPrunedBlockStore} implements full verification, which is equivalent to
* Bitcoin Core. To learn more about the alternative security models, please consult the articles on the
* website.</p>
*
* <b>Theory</b>
Expand Down
10 changes: 5 additions & 5 deletions core/src/main/java/org/bitcoinj/core/AlertMessage.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ public void setCancel(long cancel) {
}

/**
* The inclusive lower bound on software versions that are considered for the purposes of this alert. The Satoshi
* client compares this against a protocol version field, but as long as the subVer field is used to restrict it your
* The inclusive lower bound on software versions that are considered for the purposes of this alert. Bitcoin Core
* compares this against a protocol version field, but as long as the subVer field is used to restrict it your
* alerts could use any version numbers.
* @return uint32
*/
Expand All @@ -183,8 +183,8 @@ public void setMinVer(long minVer) {
}

/**
* The inclusive upper bound on software versions considered for the purposes of this alert. The Satoshi
* client compares this against a protocol version field, but as long as the subVer field is used to restrict it your
* The inclusive upper bound on software versions considered for the purposes of this alert. Bitcoin Core
* compares this against a protocol version field, but as long as the subVer field is used to restrict it your
* alerts could use any version numbers.
*/
public long getMaxVer() {
Expand Down Expand Up @@ -220,7 +220,7 @@ public void setComment(String comment) {
}

/**
* A string that is intended to display in the status bar of the official GUI client. It contains the user-visible
* A string that is intended to display in the status bar of Bitcoin Core's GUI client. It contains the user-visible
* message. English only.
*/
public String getStatusBar() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public Message deserialize(ByteBuffer in) throws ProtocolException, IOException
// The checksum is the first 4 bytes of a SHA256 hash of the message payload. It isn't
// present for all messages, notably, the first one on a connection.
//
// Satoshi's implementation ignores garbage before the magic header bytes. We have to do the same because
// Bitcoin Core ignores garbage before the magic header bytes. We have to do the same because
// sometimes it sends us stuff that isn't part of any message.
seekPastMagicBytes(in);
BitcoinPacketHeader header = new BitcoinPacketHeader(in);
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/org/bitcoinj/core/Block.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public enum VerifyFlag {
/** How many bytes are required to represent a block header WITHOUT the trailing 00 length byte. */
public static final int HEADER_SIZE = 80;

static final long ALLOWED_TIME_DRIFT = 2 * 60 * 60; // Same value as official client.
static final long ALLOWED_TIME_DRIFT = 2 * 60 * 60; // Same value as Bitcoin Core.

/**
* A constant shared by the entire network: how large in bytes a block is allowed to be. One day we may have to
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/org/bitcoinj/core/BloomFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public enum BloomUpdate {
private long nTweak;
private byte nFlags;

// Same value as the reference client
// Same value as Bitcoin Core
// A filter of 20,000 items and a false positive rate of 0.1% or one of 10,000 items and 0.0001% is just under 36,000 bytes
private static final long MAX_FILTER_SIZE = 36000;
// There is little reason to ever have more hash functions than 50 given a limit of 36,000 bytes
Expand Down
10 changes: 5 additions & 5 deletions core/src/main/java/org/bitcoinj/core/ECKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ private static ECPoint getPointWithCompression(ECPoint point, boolean compressed
}

/**
* Construct an ECKey from an ASN.1 encoded private key. These are produced by OpenSSL and stored by the Bitcoin
* reference implementation in its wallet. Note that this is slow because it requires an EC point multiply.
* Construct an ECKey from an ASN.1 encoded private key. These are produced by OpenSSL and stored by Bitcoin
* Core in its wallet. Note that this is slow because it requires an EC point multiply.
*/
public static ECKey fromASN1(byte[] asn1privkey) {
return extractKeyFromASN1(asn1privkey);
Expand Down Expand Up @@ -414,8 +414,8 @@ public boolean isWatching() {
}

/**
* Output this ECKey as an ASN.1 encoded private key, as understood by OpenSSL or used by the Bitcoin reference
* implementation in its wallet storage format.
* Output this ECKey as an ASN.1 encoded private key, as understood by OpenSSL or used by Bitcoin Core
* in its wallet storage format.
* @throws org.bitcoinj.core.ECKey.MissingPrivateKeyException if the private key is missing or encrypted.
*/
public byte[] toASN1() {
Expand Down Expand Up @@ -1001,7 +1001,7 @@ public byte[] getPrivKeyBytes() {
}

/**
* Exports the private key in the form used by the Satoshi client "dumpprivkey" and "importprivkey" commands. Use
* Exports the private key in the form used by Bitcoin Core's "dumpprivkey" and "importprivkey" commands. Use
* the {@link org.bitcoinj.core.DumpedPrivateKey#toString()} method to get the string.
*
* @param params The network this key is intended for use on.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
* Bitcoin system, with the downside being a large cost in system resources. Fully verifying means all unspent
* transaction outputs are stored. Once a transaction output is spent and that spend is buried deep enough, the data
* related to it is deleted to ensure disk space usage doesn't grow forever. For this reason a pruning node cannot
* serve the full block chain to other clients, but it nevertheless provides the same security guarantees as a regular
* Satoshi client does.</p>
* serve the full block chain to other clients, but it nevertheless provides the same security guarantees as Bitcoin
* Core does.</p>
*/
public class FullPrunedBlockChain extends AbstractBlockChain {
private static final Logger log = LoggerFactory.getLogger(FullPrunedBlockChain.class);
Expand Down Expand Up @@ -265,7 +265,7 @@ protected TransactionOutputChanges connectTransactions(int height, Block block)
throw new VerificationException("Tried to spend coinbase at depth " + (height - prevOut.getHeight()));
}
}
// TODO: Check we're not spending the genesis transaction here. Satoshis code won't allow it.
// TODO: Check we're not spending the genesis transaction here. Bitcoin Core won't allow it.
valueIn = valueIn.add(prevOut.getValue());
if (verifyFlags.contains(VerifyFlag.P2SH)) {
if (prevOut.getScript().isPayToScriptHash())
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/org/bitcoinj/core/Peer.java
Original file line number Diff line number Diff line change
Expand Up @@ -1152,9 +1152,9 @@ protected void processInv(InventoryMessage inv) {
// 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.
//
// Note that as of June 2012 the Satoshi client won't actually ever interleave blocks pushed as
// 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
// the duplicate check in blockChainDownloadLocked(). But the satoshi client may change in future so
// the duplicate check in blockChainDownloadLocked(). But Bitcoin Core may change in future so
// it's better to be safe here.
if (!pendingBlockDownloads.contains(item.hash)) {
if (vPeerVersionMessage.isBloomFilteringSupported() && useFilteredBlocks) {
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/org/bitcoinj/core/RejectMessage.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public enum RejectCode {
DUPLICATE((byte) 0x12),
/**
* The message described an object was not standard and was thus not accepted.
* The reference client has a concept of standard transaction forms, which describe scripts and encodings which
* Bitcoin Core has a concept of standard transaction forms, which describe scripts and encodings which
* it is willing to relay further. Other transactions are neither relayed nor mined, though they are considered
* valid if they appear in a block.
*/
Expand Down
16 changes: 8 additions & 8 deletions core/src/main/java/org/bitcoinj/core/Transaction.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public int compare(final Transaction tx1, final Transaction tx2) {
public static final int MAX_STANDARD_TX_SIZE = 100000;

/**
* If fee is lower than this value (in satoshis), a default reference client will treat it as if there were no fee.
* If fee is lower than this value (in satoshis), Bitcoin Core will treat it as if there were no fee.
* Currently this is 1000 satoshis.
*/
public static final Coin REFERENCE_DEFAULT_MIN_TX_FEE = Coin.valueOf(1000);
Expand Down Expand Up @@ -493,8 +493,8 @@ public void setUpdateTime(Date updatedAt) {
* These constants are a part of a scriptSig signature on the inputs. They define the details of how a
* transaction can be redeemed, specifically, they control how the hash of the transaction is calculated.
* <p/>
* In the official client, this enum also has another flag, SIGHASH_ANYONECANPAY. In this implementation,
* that's kept separate. Only SIGHASH_ALL is actually used in the official client today. The other flags
* In Bitcoin Core, this enum also has another flag, SIGHASH_ANYONECANPAY. In this implementation,
* that's kept separate. Only SIGHASH_ALL is actually used in Bitcoin Core today. The other flags
* exist to allow for distributed contracts.
*/
public enum SigHash {
Expand Down Expand Up @@ -963,7 +963,7 @@ public synchronized Sha256Hash hashForSignature(int inputIndex, byte[] connected
inputs.get(i).setScriptBytes(TransactionInput.EMPTY_ARRAY);
}

// This step has no purpose beyond being synchronized with the reference clients bugs. OP_CODESEPARATOR
// This step has no purpose beyond being synchronized with Bitcoin Core's bugs. OP_CODESEPARATOR
// is a legacy holdover from a previous, broken design of executing scripts that shipped in Bitcoin 0.1.
// It was seriously flawed and would have let anyone take anyone elses money. Later versions switched to
// the design we use today where scripts are executed independently but share a stack. This left the
Expand All @@ -972,7 +972,7 @@ public synchronized Sha256Hash hashForSignature(int inputIndex, byte[] connected
// do it, we could split off the main chain.
connectedScript = Script.removeAllInstancesOfOp(connectedScript, ScriptOpCodes.OP_CODESEPARATOR);

// Set the input to the script of its output. Satoshi does this but the step has no obvious purpose as
// Set the input to the script of its output. Bitcoin Core does this but the step has no obvious purpose as
// the signature covers the hash of the prevout transaction which obviously includes the output script
// already. Perhaps it felt safer to him in some way, or is another leftover from how the code was written.
TransactionInput input = inputs.get(inputIndex);
Expand All @@ -990,7 +990,7 @@ public synchronized Sha256Hash hashForSignature(int inputIndex, byte[] connected
// SIGHASH_SINGLE means only sign the output at the same index as the input (ie, my output).
if (inputIndex >= this.outputs.size()) {
// The input index is beyond the number of outputs, it's a buggy signature made by a broken
// Bitcoin implementation. The reference client also contains a bug in handling this case:
// Bitcoin implementation. Bitcoin Core also contains a bug in handling this case:
// any transaction output that is signed in this case will result in both the signed output
// and any future outputs to this public key being steal-able by anyone who has
// the resulting signature and the public key (both of which are part of the signed tx input).
Expand All @@ -1002,7 +1002,7 @@ public synchronized Sha256Hash hashForSignature(int inputIndex, byte[] connected
inputs.get(i).setSequenceNumber(inputSequenceNumbers[i]);
}
this.outputs = outputs;
// Satoshis bug is that SignatureHash was supposed to return a hash and on this codepath it
// Bitcoin Core's bug is that SignatureHash was supposed to return a hash and on this codepath it
// actually returns the constant "1" to indicate an error, which is never checked for. Oops.
return Sha256Hash.wrap("0100000000000000000000000000000000000000000000000000000000000000");
}
Expand Down Expand Up @@ -1297,7 +1297,7 @@ public boolean isTimeLocked() {
* This is useful in certain types of <a href="http://en.bitcoin.it/wiki/Contracts">contracts</a>, such as
* micropayment channels.</p>
*
* <p>Note that currently the replacement feature is disabled in the Satoshi client and will need to be
* <p>Note that currently the replacement feature is disabled in Bitcoin Core and will need to be
* re-activated before this functionality is useful.</p>
*/
public boolean isFinal(int height, long blockTimeSeconds) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ public void run() {
// Only bother with this if we might actually hear back:
if (minConnections > 1)
tx.getConfidence().addEventListener(new ConfidenceChange());
// Satoshis code sends an inv in this case and then lets the peer request the tx data. We just
// Bitcoin Core sends an inv in this case and then lets the peer request the tx data. We just
// blast out the TX here for a couple of reasons. Firstly it's simpler: in the case where we have
// just a single connection we don't have to wait for getdata to be received and handled before
// completing the future in the code immediately below. Secondly, it's faster. The reason the
// Satoshi client sends an inv is privacy - it means you can't tell if the peer originated the
// Bitcoin Core sends an inv is privacy - it means you can't tell if the peer originated the
// transaction or not. However, we are not a fully validating node and this is advertised in
// our version message, as SPV nodes cannot relay it doesn't give away any additional information
// to skip the inv here - we wouldn't send invs anyway.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,8 @@ public synchronized int incrementDepthInBlocks() {

/**
* <p>Depth in the chain is an approximation of how much time has elapsed since the transaction has been confirmed.
* On average there is supposed to be a new block every 10 minutes, but the actual rate may vary. The reference
* (Satoshi) implementation considers a transaction impractical to reverse after 6 blocks, but as of EOY 2011 network
* On average there is supposed to be a new block every 10 minutes, but the actual rate may vary. Bitcoin Core
* 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.</p>
*
Expand Down
10 changes: 5 additions & 5 deletions core/src/main/java/org/bitcoinj/core/TransactionOutput.java
Original file line number Diff line number Diff line change
Expand Up @@ -204,23 +204,23 @@ public int getIndex() {
}

/**
* <p>Gets the minimum value for a txout of this size to be considered non-dust by a reference client
* (and thus relayed). See: CTxOut::IsDust() in the reference client. The assumption is that any output that would
* <p>Gets the minimum value for a txout of this size to be considered non-dust by Bitcoin Core
* (and thus relayed). See: CTxOut::IsDust() in Bitcoin Core. The assumption is that any output that would
* consume more than a third of its value in fees is not something the Bitcoin system wants to deal with right now,
* so we call them "dust outputs" and they're made non standard. The choice of one third is somewhat arbitrary and
* may change in future.</p>
*
* <p>You probably should use {@link org.bitcoinj.core.TransactionOutput#getMinNonDustValue()} which uses
* a safe fee-per-kb by default.</p>
*
* @param feePerKbRequired The fee required per kilobyte. Note that this is the same as the reference client's -minrelaytxfee * 3
* @param feePerKbRequired The fee required per kilobyte. Note that this is the same as Bitcoin Core's -minrelaytxfee * 3
* If you want a safe default, use {@link Transaction#REFERENCE_DEFAULT_MIN_TX_FEE}*3
*/
public Coin getMinNonDustValue(Coin feePerKbRequired) {
// A typical output is 33 bytes (pubkey hash + opcodes) and requires an input of 148 bytes to spend so we add
// that together to find out the total amount of data used to transfer this amount of value. Note that this
// formula is wrong for anything that's not a pay-to-address output, unfortunately, we must follow the reference
// clients wrongness in order to ensure we're considered standard. A better formula would either estimate the
// formula is wrong for anything that's not a pay-to-address output, unfortunately, we must follow Bitcoin Core's
// wrongness in order to ensure we're considered standard. A better formula would either estimate the
// size of data needed to satisfy all different script types, or just hard code 33 below.
final long size = this.bitcoinSerialize().length + 148;
Coin[] nonDustAndRemainder = feePerKbRequired.multiply(size).divideAndRemainder(1000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* announce the transaction within a reasonable time, it may be that the TX is not valid. Alternatively, an attacker
* may control your entire internet connection: in this scenario counting broadcasting peers does not help you.</p>
*
* <p>It is <b>not</b> at this time directly equivalent to the Satoshi clients memory pool, which tracks
* <p>It is <b>not</b> at this time directly equivalent to the Bitcoin Core memory pool, which tracks
* all transactions not currently included in the best chain - it's simply a cache.</p>
*/
public class TxConfidenceTable {
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/org/bitcoinj/core/VersionMessage.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class VersionMessage extends Message {
public PeerAddress theirAddr;
/**
* User-Agent as defined in <a href="https://github.com/bitcoin/bips/blob/master/bip-0014.mediawiki">BIP 14</a>.
* The official client sets it to something like "/Satoshi:0.9.1/".
* Bitcoin Core sets it to something like "/Satoshi:0.9.1/".
*/
public String subVer;
/**
Expand Down Expand Up @@ -92,7 +92,7 @@ public VersionMessage(NetworkParameters params, int newBestHeight) {
clientVersion = params.getProtocolVersionNum(NetworkParameters.ProtocolVersion.CURRENT);
localServices = 0;
time = System.currentTimeMillis() / 1000;
// Note that the official client doesn't do anything with these, and finding out your own external IP address
// Note that the Bitcoin Core doesn't do anything with these, and finding out your own external IP address
// is kind of tricky anyway, so we just put nonsense here for now.
try {
// We hard-code the IPv4 localhost address here rather than use InetAddress.getLocalHost() because some
Expand Down

0 comments on commit 7cb7fec

Please sign in to comment.