mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-01-31 23:32:16 +00:00
BitCoin -> Bitcoin
This commit is contained in:
parent
e57068451d
commit
53fcef761e
@ -79,7 +79,7 @@ public abstract class AbstractBlockChain {
|
|||||||
/**
|
/**
|
||||||
* Tracks the top of the best known chain.<p>
|
* Tracks the top of the best known chain.<p>
|
||||||
*
|
*
|
||||||
* Following this one down to the genesis block produces the story of the economy from the creation of BitCoin
|
* Following this one down to the genesis block produces the story of the economy from the creation of Bitcoin
|
||||||
* until the present day. The chain head can change if a new set of blocks is received that results in a chain of
|
* until the present day. The chain head can change if a new set of blocks is received that results in a chain of
|
||||||
* greater work than the one obtained by following this one down. In that case a reorganize is triggered,
|
* greater work than the one obtained by following this one down. In that case a reorganize is triggered,
|
||||||
* potentially invalidating transactions in our wallet.
|
* potentially invalidating transactions in our wallet.
|
||||||
|
@ -70,7 +70,7 @@ public class Address extends VersionedChecksummedBytes {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The (big endian) 20 byte hash that is the core of a BitCoin address. */
|
/** The (big endian) 20 byte hash that is the core of a Bitcoin address. */
|
||||||
public byte[] getHash160() {
|
public byte[] getHash160() {
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
@ -114,7 +114,7 @@ public class Block extends Message {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contruct a block object from the BitCoin wire format.
|
* Contruct a block object from the Bitcoin wire format.
|
||||||
* @param params NetworkParameters object.
|
* @param params NetworkParameters object.
|
||||||
* @param parseLazy Whether to perform a full parse immediately or delay until a read is requested.
|
* @param parseLazy Whether to perform a full parse immediately or delay until a read is requested.
|
||||||
* @param parseRetain Whether to retain the backing byte array for quick reserialization.
|
* @param parseRetain Whether to retain the backing byte array for quick reserialization.
|
||||||
@ -811,7 +811,7 @@ public class Block extends Message {
|
|||||||
hash = null;
|
hash = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns the version of the block data structure as defined by the BitCoin protocol. */
|
/** Returns the version of the block data structure as defined by the Bitcoin protocol. */
|
||||||
public long getVersion() {
|
public long getVersion() {
|
||||||
maybeParseHeader();
|
maybeParseHeader();
|
||||||
return version;
|
return version;
|
||||||
|
@ -111,7 +111,7 @@ public class ECKey implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct an ECKey from an ASN.1 encoded private key. These are produced by OpenSSL and stored by the BitCoin
|
* 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.
|
* reference implementation in its wallet. Note that this is slow because it requires an EC point multiply.
|
||||||
*/
|
*/
|
||||||
public static ECKey fromASN1(byte[] asn1privkey) {
|
public static ECKey fromASN1(byte[] asn1privkey) {
|
||||||
|
@ -150,7 +150,7 @@ public abstract class Message implements Serializable {
|
|||||||
this(params, msg, offset, NetworkParameters.PROTOCOL_VERSION, parseLazy, parseRetain, length);
|
this(params, msg, offset, NetworkParameters.PROTOCOL_VERSION, parseLazy, parseRetain, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
// These methods handle the serialization/deserialization using the custom BitCoin protocol.
|
// These methods handle the serialization/deserialization using the custom Bitcoin protocol.
|
||||||
// It's somewhat painful to work with in Java, so some of these objects support a second
|
// It's somewhat painful to work with in Java, so some of these objects support a second
|
||||||
// serialization mechanism - the standard Java serialization system. This is used when things
|
// serialization mechanism - the standard Java serialization system. This is used when things
|
||||||
// are serialized to the wallet.
|
// are serialized to the wallet.
|
||||||
|
@ -61,7 +61,7 @@ public class NetworkParameters implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* <p>Genesis block for this chain.</p>
|
* <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 implemenetations. For a
|
||||||
* block to be valid, it must be eventually possible to work backwards to the genesis block by following the
|
* 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>
|
* prevBlockHash pointers in the block headers.</p>
|
||||||
*
|
*
|
||||||
|
@ -529,7 +529,7 @@ public class Transaction extends ChildMessage implements Serializable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* A coinbase transaction is one that creates a new coin. They are the first transaction in each block and their
|
* A coinbase transaction is one that creates a new coin. They are the first transaction in each block and their
|
||||||
* value is determined by a formula that all implementations of BitCoin share. In 2011 the value of a coinbase
|
* value is determined by a formula that all implementations of Bitcoin share. In 2011 the value of a coinbase
|
||||||
* transaction is 50 coins, but in future it will be less. A coinbase transaction is defined not only by its
|
* transaction is 50 coins, but in future it will be less. A coinbase transaction is defined not only by its
|
||||||
* position in a block but by the data in the inputs.
|
* position in a block but by the data in the inputs.
|
||||||
*/
|
*/
|
||||||
|
@ -60,9 +60,9 @@ public class Utils {
|
|||||||
// TODO: Replace this nanocoins business with something better.
|
// TODO: Replace this nanocoins business with something better.
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* How many "nanocoins" there are in a BitCoin.
|
* How many "nanocoins" there are in a Bitcoin.
|
||||||
* <p/>
|
* <p/>
|
||||||
* A nanocoin is the smallest unit that can be transferred using BitCoin.
|
* A nanocoin is the smallest unit that can be transferred using Bitcoin.
|
||||||
* The term nanocoin is very misleading, though, because there are only 100 million
|
* The term nanocoin is very misleading, though, because there are only 100 million
|
||||||
* of them in a coin (whereas one would expect 1 billion.
|
* of them in a coin (whereas one would expect 1 billion.
|
||||||
*/
|
*/
|
||||||
@ -71,7 +71,7 @@ public class Utils {
|
|||||||
/**
|
/**
|
||||||
* How many "nanocoins" there are in 0.01 BitCoins.
|
* How many "nanocoins" there are in 0.01 BitCoins.
|
||||||
* <p/>
|
* <p/>
|
||||||
* A nanocoin is the smallest unit that can be transferred using BitCoin.
|
* A nanocoin is the smallest unit that can be transferred using Bitcoin.
|
||||||
* The term nanocoin is very misleading, though, because there are only 100 million
|
* The term nanocoin is very misleading, though, because there are only 100 million
|
||||||
* of them in a coin (whereas one would expect 1 billion).
|
* of them in a coin (whereas one would expect 1 billion).
|
||||||
*/
|
*/
|
||||||
|
@ -30,7 +30,7 @@ public class VarInt {
|
|||||||
originallyEncodedSize = getSizeInBytes();
|
originallyEncodedSize = getSizeInBytes();
|
||||||
}
|
}
|
||||||
|
|
||||||
// BitCoin has its own varint format, known in the C++ source as "compact size".
|
// Bitcoin has its own varint format, known in the C++ source as "compact size".
|
||||||
public VarInt(byte[] buf, int offset) {
|
public VarInt(byte[] buf, int offset) {
|
||||||
int first = 0xFF & buf[offset];
|
int first = 0xFF & buf[offset];
|
||||||
long val;
|
long val;
|
||||||
|
@ -127,7 +127,7 @@ public class Wallet implements Serializable, BlockChainListener {
|
|||||||
* may have unspent "change" outputs.<p>
|
* may have unspent "change" outputs.<p>
|
||||||
* <p/>
|
* <p/>
|
||||||
* Note: for now we will not allow spends of transactions that did not make it into the block chain. The code
|
* Note: for now we will not allow spends of transactions that did not make it into the block chain. The code
|
||||||
* that handles this in BitCoin C++ is complicated. Satoshis code will not allow you to spend unconfirmed coins,
|
* that handles this in Bitcoin C++ is complicated. Satoshis code will not allow you to spend unconfirmed coins,
|
||||||
* however, it does seem to support dependency resolution entirely within the context of the memory pool so
|
* however, it does seem to support dependency resolution entirely within the context of the memory pool so
|
||||||
* theoretically you could spend zero-conf coins and all of them would be included together. To simplify we'll
|
* theoretically you could spend zero-conf coins and all of them would be included together. To simplify we'll
|
||||||
* make people wait but it would be a good improvement to resolve this in future.
|
* make people wait but it would be a good improvement to resolve this in future.
|
||||||
@ -1590,7 +1590,7 @@ public class Wallet implements Serializable, BlockChainListener {
|
|||||||
* prevent this, but that should only occur once the transaction has been accepted by the network. This implies
|
* prevent this, but that should only occur once the transaction has been accepted by the network. This implies
|
||||||
* you cannot have more than one outstanding sending tx at once.</p>
|
* you cannot have more than one outstanding sending tx at once.</p>
|
||||||
*
|
*
|
||||||
* @param address The BitCoin address to send the money to.
|
* @param address The Bitcoin address to send the money to.
|
||||||
* @param nanocoins How much currency to send, in nanocoins.
|
* @param nanocoins How much currency to send, in nanocoins.
|
||||||
* @return either the created Transaction or null if there are insufficient coins.
|
* @return either the created Transaction or null if there are insufficient coins.
|
||||||
* coins as spent until commitTx is called on the result.
|
* coins as spent until commitTx is called on the result.
|
||||||
|
Loading…
Reference in New Issue
Block a user