Commit 0a6f901b authored by Mike Hearn's avatar Mike Hearn

Renamespace to org.bitcoinj away from com.google.bitcoin, as bitcoinj is no...

Renamespace to org.bitcoinj away from com.google.bitcoin, as bitcoinj is no longer a Google project and being namespaced under com.google causes issues with Sonatype/Maven Central.

To fixinate your code:

find . -name '*.java' | xargs sed -i .bak 's/import com.google.bitcoin./import org.bitcoinj./g;s/import static com.google.bitcoin./import static org.bitcoinj./g'
parent 48de05ac
......@@ -45,7 +45,7 @@ If you send coins to that address, it will forward them on to the address you sp
```
cd examples
mvn exec:java -Dexec.mainClass=com.google.bitcoin.examples.ForwardingService -Dexec.args="<insert a bitcoin address here>"
mvn exec:java -Dexec.mainClass=org.bitcoinj.examples.ForwardingService -Dexec.args="<insert a bitcoin address here>"
```
Note that this example app *does not use checkpointing*, so the initial chain sync will be pretty slow. You can make an app that starts up and does the initial sync much faster by including a checkpoints file; see the documentation for
......
......@@ -38,7 +38,7 @@
<!-- The code is correct but findbugs can't analyze it properly -->
<Match>
<Bug code="SF"/>
<Class name="com.google.bitcoin.core.BloomFilter"/>
<Class name="org.bitcoinj.core.BloomFilter"/>
</Match>
<!-- fb doesn't like the odd API this class has -->
......
......@@ -20,12 +20,12 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.google</groupId>
<groupId>org.bitcoinj</groupId>
<artifactId>bitcoinj-parent</artifactId>
<version>0.12-SNAPSHOT</version>
</parent>
<artifactId>bitcoinj</artifactId>
<artifactId>bitcoinj-core</artifactId>
<name>bitcoinj</name>
<description>A Java Bitcoin library</description>
......@@ -246,7 +246,7 @@
<artifactItems>
<artifactItem>
<outputDirectory>target/test-classes/</outputDirectory>
<groupId>com.google</groupId>
<groupId>org.bitcoinj</groupId>
<artifactId>bitcoinj</artifactId>
<version>0.12-SNAPSHOT</version>
</artifactItem>
......@@ -280,7 +280,7 @@
<configuration>
<archive>
<manifest>
<mainClass>com.google.bitcoin.core.BitcoindComparisonTool</mainClass>
<mainClass>org.bitcoinj.core.BitcoindComparisonTool</mainClass>
<addClasspath>false</addClasspath>
</manifest>
</archive>
......
......@@ -15,12 +15,12 @@
* limitations under the License.
*/
package com.google.bitcoin.core;
package org.bitcoinj.core;
import com.google.bitcoin.store.BlockStore;
import com.google.bitcoin.store.BlockStoreException;
import com.google.bitcoin.utils.ListenerRegistration;
import com.google.bitcoin.utils.Threading;
import org.bitcoinj.store.BlockStore;
import org.bitcoinj.store.BlockStoreException;
import org.bitcoinj.utils.ListenerRegistration;
import org.bitcoinj.utils.Threading;
import com.google.common.base.Preconditions;
import com.google.common.collect.Sets;
import com.google.common.util.concurrent.ListenableFuture;
......@@ -47,7 +47,7 @@ import static com.google.common.base.Preconditions.*;
* <p>An AbstractBlockChain implementation must be connected to a {@link BlockStore} implementation. The chain object
* by itself doesn't store any data, that's delegated to the store. Which store you use is a decision best made by
* reading the getting started guide, but briefly, fully validating block chains need fully validating stores. In
* the lightweight SPV mode, a {@link com.google.bitcoin.store.SPVBlockStore} is the right choice.</p>
* the lightweight SPV mode, a {@link org.bitcoinj.store.SPVBlockStore} is the right choice.</p>
*
* <p>This class implements an abstract class which makes it simple to create a BlockChain that does/doesn't do full
* verification. It verifies headers and is implements most of what is required to implement SPV mode, but
......@@ -56,7 +56,7 @@ import static com.google.common.base.Preconditions.*;
* <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 com.google.bitcoin.store.H2FullPrunedBlockStore} implements full verification, which is equivalent to the
* {@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
* website.</p>
*
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package com.google.bitcoin.core;
package org.bitcoinj.core;
import java.util.List;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package com.google.bitcoin.core;
package org.bitcoinj.core;
import java.util.List;
......
......@@ -14,10 +14,10 @@
* limitations under the License.
*/
package com.google.bitcoin.core;
package org.bitcoinj.core;
import com.google.bitcoin.script.Script;
import com.google.bitcoin.wallet.AbstractKeyChainEventListener;
import org.bitcoinj.script.Script;
import org.bitcoinj.wallet.AbstractKeyChainEventListener;
import java.util.List;
......
......@@ -15,10 +15,10 @@
* limitations under the License.
*/
package com.google.bitcoin.core;
package org.bitcoinj.core;
import com.google.bitcoin.params.Networks;
import com.google.bitcoin.script.Script;
import org.bitcoinj.params.Networks;
import org.bitcoinj.script.Script;
import javax.annotation.Nullable;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package com.google.bitcoin.core;
package org.bitcoinj.core;
@SuppressWarnings("serial")
public class AddressFormatException extends Exception {
......
package com.google.bitcoin.core;
package org.bitcoinj.core;
import java.io.IOException;
import java.io.OutputStream;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package com.google.bitcoin.core;
package org.bitcoinj.core;
import java.util.Date;
import java.util.HashSet;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package com.google.bitcoin.core;
package org.bitcoinj.core;
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
......
......@@ -15,7 +15,7 @@
* limitations under the License.
*/
package com.google.bitcoin.core;
package org.bitcoinj.core;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -28,7 +28,7 @@ import java.nio.ByteBuffer;
import java.util.HashMap;
import java.util.Map;
import static com.google.bitcoin.core.Utils.*;
import static org.bitcoinj.core.Utils.*;
/**
* <p>Methods to serialize and de-serialize messages to the Bitcoin network format as defined in
......
......@@ -14,10 +14,10 @@
* limitations under the License.
*/
package com.google.bitcoin.core;
package org.bitcoinj.core;
import com.google.bitcoin.script.Script;
import com.google.bitcoin.script.ScriptBuilder;
import org.bitcoinj.script.Script;
import org.bitcoinj.script.ScriptBuilder;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
......@@ -35,9 +35,9 @@ import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import static com.google.bitcoin.core.Coin.FIFTY_COINS;
import static com.google.bitcoin.core.Utils.doubleDigest;
import static com.google.bitcoin.core.Utils.doubleDigestTwoBuffers;
import static org.bitcoinj.core.Coin.FIFTY_COINS;
import static org.bitcoinj.core.Utils.doubleDigest;
import static org.bitcoinj.core.Utils.doubleDigestTwoBuffers;
/**
* <p>A block is a group of transactions, and is one of the fundamental data structures of the Bitcoin system.
......@@ -164,7 +164,7 @@ public class Block extends Message {
* the system it was 50 coins per block, in late 2012 it went to 25 coins per block, and so on. The size of
* a coinbase transaction is inflation plus fees.</p>
*
* <p>The half-life is controlled by {@link com.google.bitcoin.core.NetworkParameters#getSubsidyDecreaseBlockCount()}.
* <p>The half-life is controlled by {@link org.bitcoinj.core.NetworkParameters#getSubsidyDecreaseBlockCount()}.
* </p>
*/
public Coin getBlockInflation(int height) {
......@@ -915,7 +915,7 @@ public class Block extends Message {
* Returns the difficulty of the proof of work that this block should meet encoded <b>in compact form</b>. The {@link
* BlockChain} verifies that this is not too easy by looking at the length of the chain when the block is added.
* To find the actual value the hash should be compared against, use
* {@link com.google.bitcoin.core.Block#getDifficultyTargetAsInteger()}. Note that this is <b>not</b> the same as
* {@link org.bitcoinj.core.Block#getDifficultyTargetAsInteger()}. Note that this is <b>not</b> the same as
* the difficulty value reported by the Bitcoin "getdifficulty" RPC that you may see on various block explorers.
* That number is the result of applying a formula to the underlying difficulty to normalize the minimum to 1.
* Calculating the difficulty that way is currently unsupported.
......
......@@ -15,12 +15,12 @@
* limitations under the License.
*/
package com.google.bitcoin.core;
package org.bitcoinj.core;
import static com.google.common.base.Preconditions.checkArgument;
import com.google.bitcoin.store.BlockStore;
import com.google.bitcoin.store.BlockStoreException;
import org.bitcoinj.store.BlockStore;
import org.bitcoinj.store.BlockStoreException;
import java.util.ArrayList;
import java.util.List;
......@@ -40,8 +40,8 @@ public class BlockChain extends AbstractBlockChain {
* one from scratch, or you can deserialize a saved wallet from disk using {@link Wallet#loadFromFile(java.io.File)}
* </p>
*
* <p>For the store, you should use {@link com.google.bitcoin.store.SPVBlockStore} or you could also try a
* {@link com.google.bitcoin.store.MemoryBlockStore} if you want to hold all headers in RAM and don't care about
* <p>For the store, you should use {@link org.bitcoinj.store.SPVBlockStore} or you could also try a
* {@link org.bitcoinj.store.MemoryBlockStore} if you want to hold all headers in RAM and don't care about
* disk serialization (this is rare).</p>
*/
public BlockChain(NetworkParameters params, Wallet wallet, BlockStore blockStore) throws BlockStoreException {
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package com.google.bitcoin.core;
package org.bitcoinj.core;
import java.util.List;
......@@ -26,8 +26,8 @@ import java.util.List;
public interface BlockChainListener {
/**
* Called when a new block on the best chain is seen, after relevant transactions are extracted and sent to
* us via either {@link #receiveFromBlock(Transaction, StoredBlock, com.google.bitcoin.core.BlockChain.NewBlockType, int)}
* or {@link #notifyTransactionIsInBlock(Sha256Hash, StoredBlock, com.google.bitcoin.core.BlockChain.NewBlockType, int)}.
* us via either {@link #receiveFromBlock(Transaction, StoredBlock, org.bitcoinj.core.BlockChain.NewBlockType, int)}
* or {@link #notifyTransactionIsInBlock(Sha256Hash, StoredBlock, org.bitcoinj.core.BlockChain.NewBlockType, int)}.
* If this block is causing a re-organise to a new chain, this method is NOT called even though the block may be
* the new best block: your reorganize implementation is expected to do whatever would normally be done do for a new
* best block in this case.
......
......@@ -14,10 +14,10 @@
* limitations under the License.
*/
package com.google.bitcoin.core;
package org.bitcoinj.core;
import com.google.bitcoin.script.Script;
import com.google.bitcoin.script.ScriptChunk;
import org.bitcoinj.script.Script;
import org.bitcoinj.script.ScriptChunk;
import com.google.common.base.Objects;
import com.google.common.collect.Lists;
......@@ -100,7 +100,7 @@ public class BloomFilter extends Message {
* It should be a random value, however secureness of the random value is of no great consequence.</p>
*
* <p>updateFlag is used to control filter behaviour on the server (remote node) side when it encounters a hit.
* See {@link com.google.bitcoin.core.BloomFilter.BloomUpdate} for a brief description of each mode. The purpose
* See {@link org.bitcoinj.core.BloomFilter.BloomUpdate} for a brief description of each mode. The purpose
* of this flag is to reduce network round-tripping and avoid over-dirtying the filter for the most common
* wallet configurations.</p>
*/
......@@ -270,7 +270,7 @@ public class BloomFilter extends Message {
}
/**
* Returns true if this filter will match anything. See {@link com.google.bitcoin.core.BloomFilter#setMatchAll()}
* Returns true if this filter will match anything. See {@link org.bitcoinj.core.BloomFilter#setMatchAll()}
* for when this can be a useful thing to do.
*/
public synchronized boolean matchesAll() {
......
......@@ -14,11 +14,11 @@
* limitations under the License.
*/
package com.google.bitcoin.core;
package org.bitcoinj.core;
import com.google.bitcoin.store.BlockStore;
import com.google.bitcoin.store.BlockStoreException;
import com.google.bitcoin.store.FullPrunedBlockStore;
import org.bitcoinj.store.BlockStore;
import org.bitcoinj.store.BlockStoreException;
import org.bitcoinj.store.FullPrunedBlockStore;
import com.google.common.base.Charsets;
import com.google.common.hash.HashCode;
import com.google.common.hash.Hasher;
......@@ -55,7 +55,7 @@ import static com.google.common.base.Preconditions.*;
* </ol>
*
* <p>Checkpoints are used by the SPV {@link BlockChain} to initialize fresh
* {@link com.google.bitcoin.store.SPVBlockStore}s. They are not used by fully validating mode, which instead has a
* {@link org.bitcoinj.store.SPVBlockStore}s. They are not used by fully validating mode, which instead has a
* different concept of checkpoints that are used to hard-code the validity of blocks that violate BIP30 (duplicate
* coinbase transactions). Those "checkpoints" can be found in NetworkParameters.</p>
*
......
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.bitcoin.core;
package org.bitcoinj.core;
import javax.annotation.Nullable;
......
......@@ -14,9 +14,9 @@
* limitations under the License.
*/
package com.google.bitcoin.core;
package org.bitcoinj.core;
import com.google.bitcoin.utils.MonetaryFormat;
import org.bitcoinj.utils.MonetaryFormat;
import com.google.common.math.LongMath;
import java.io.Serializable;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package com.google.bitcoin.core;
package org.bitcoinj.core;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package com.google.bitcoin.core;
package org.bitcoinj.core;
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
......
......@@ -15,9 +15,9 @@
* limitations under the License.
*/
package com.google.bitcoin.core;
package org.bitcoinj.core;
import com.google.bitcoin.crypto.*;
import org.bitcoinj.crypto.*;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
......@@ -368,7 +368,7 @@ public class ECKey implements EncryptableItem, Serializable {
/**
* 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.
* @throws com.google.bitcoin.core.ECKey.MissingPrivateKeyException if the private key is missing or encrypted.
* @throws org.bitcoinj.core.ECKey.MissingPrivateKeyException if the private key is missing or encrypted.
*/
public byte[] toASN1() {
try {
......@@ -553,7 +553,7 @@ public class ECKey implements EncryptableItem, Serializable {
/**
* Signs the given hash and returns the R and S components as BigIntegers. In the Bitcoin protocol, they are
* usually encoded using ASN.1 format, so you want {@link com.google.bitcoin.core.ECKey.ECDSASignature#toASN1()}
* usually encoded using ASN.1 format, so you want {@link org.bitcoinj.core.ECKey.ECDSASignature#toASN1()}
* instead. However sometimes the independent components can be useful, for instance, if you're going to do
* further EC maths on them.
* @throws KeyCrypterException if this ECKey doesn't have a private part.
......@@ -572,7 +572,7 @@ public class ECKey implements EncryptableItem, Serializable {
/**
* Signs the given hash and returns the R and S components as BigIntegers. In the Bitcoin protocol, they are
* usually encoded using DER format, so you want {@link com.google.bitcoin.core.ECKey.ECDSASignature#encodeToDER()}
* usually encoded using DER format, so you want {@link org.bitcoinj.core.ECKey.ECDSASignature#encodeToDER()}
* instead. However sometimes the independent components can be useful, for instance, if you're doing to do further
* EC maths on them.
*
......@@ -897,7 +897,7 @@ public class ECKey implements EncryptableItem, Serializable {
/**
* Returns a 32 byte array containing the private key.
* @throws com.google.bitcoin.core.ECKey.MissingPrivateKeyException if the private key bytes are missing/encrypted.
* @throws org.bitcoinj.core.ECKey.MissingPrivateKeyException if the private key bytes are missing/encrypted.
*/
public byte[] getPrivKeyBytes() {
return Utils.bigIntegerToBytes(getPrivKey(), 32);
......@@ -905,7 +905,7 @@ public class ECKey implements EncryptableItem, Serializable {
/**
* Exports the private key in the form used by the Satoshi client "dumpprivkey" and "importprivkey" commands. Use
* the {@link com.google.bitcoin.core.DumpedPrivateKey#toString()} method to get the string.
* the {@link org.bitcoinj.core.DumpedPrivateKey#toString()} method to get the string.
*
* @param params The network this key is intended for use on.
* @return Private key bytes as a {@link DumpedPrivateKey}.
......
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.bitcoin.core;
package org.bitcoinj.core;
import java.io.IOException;
import java.io.OutputStream;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package com.google.bitcoin.core;
package org.bitcoinj.core;
import java.io.IOException;
import java.io.OutputStream;
......
......@@ -15,12 +15,12 @@
* limitations under the License.
*/
package com.google.bitcoin.core;
package org.bitcoinj.core;
import com.google.bitcoin.script.Script;
import com.google.bitcoin.script.Script.VerifyFlag;
import com.google.bitcoin.store.BlockStoreException;
import com.google.bitcoin.store.FullPrunedBlockStore;
import org.bitcoinj.script.Script;
import org.bitcoinj.script.Script.VerifyFlag;
import org.bitcoinj.store.BlockStoreException;
import org.bitcoinj.store.FullPrunedBlockStore;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package com.google.bitcoin.core;
package org.bitcoinj.core;
/**
* Represents the "getaddr" P2P protocol message, which requests network {@link AddressMessage}s from a peer. Not to
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package com.google.bitcoin.core;
package org.bitcoinj.core;
import java.io.IOException;
import java.io.OutputStream;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package com.google.bitcoin.core;
package org.bitcoinj.core;
/**
* Represents the "getdata" P2P network message, which requests the contents of blocks or transactions given their
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package com.google.bitcoin.core;
package org.bitcoinj.core;
import java.util.List;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package com.google.bitcoin.core;
package org.bitcoinj.core;
import com.google.common.collect.ImmutableList;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package com.google.bitcoin.core;
package org.bitcoinj.core;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......