Fixed merge conflicts

This commit is contained in:
Chris Stewart 2016-05-26 15:55:17 -05:00
commit e1a3b2dc9f
4 changed files with 6 additions and 3 deletions

View file

@ -41,7 +41,6 @@ sealed trait Block extends NetworkElement with BitcoinSLogger {
*/ */
def hash : DoubleSha256Digest = CryptoUtil.doubleSHA256(bytes) def hash : DoubleSha256Digest = CryptoUtil.doubleSHA256(bytes)
def hex = RawBlockSerializer.write(this) def hex = RawBlockSerializer.write(this)
} }

View file

@ -5,6 +5,7 @@ import org.bitcoins.core.protocol.NetworkElement
import org.bitcoins.core.serializers.blockchain.RawBlockHeaderSerializer import org.bitcoins.core.serializers.blockchain.RawBlockHeaderSerializer
import org.bitcoins.core.util.{BitcoinSLogger, Factory} import org.bitcoins.core.util.{BitcoinSLogger, Factory}
/** /**
* Created by chris on 5/19/16. * Created by chris on 5/19/16.
* Nodes collect new transactions into a block, hash them into a hash tree, * Nodes collect new transactions into a block, hash them into a hash tree,
@ -37,6 +38,7 @@ sealed trait BlockHeader extends NetworkElement with BitcoinSLogger {
* *
* @return the previous block's hash * @return the previous block's hash
*/ */
def previousBlockHash : DoubleSha256Digest def previousBlockHash : DoubleSha256Digest
/** /**
@ -47,8 +49,8 @@ sealed trait BlockHeader extends NetworkElement with BitcoinSLogger {
* *
* @return the merkle root of the merkle tree * @return the merkle root of the merkle tree
*/ */
def merkleRootHash : DoubleSha256Digest
def merkleRootHash : DoubleSha256Digest
/** /**
* The block time is a Unix epoch time when the miner started hashing the header (according to the miner). * The block time is a Unix epoch time when the miner started hashing the header (according to the miner).
@ -78,6 +80,7 @@ sealed trait BlockHeader extends NetworkElement with BitcoinSLogger {
def nonce : Long def nonce : Long
override def hex : String = RawBlockHeaderSerializer.write(this) override def hex : String = RawBlockHeaderSerializer.write(this)
} }
@ -97,4 +100,5 @@ object BlockHeader extends Factory[BlockHeader] {
def fromBytes(bytes : Seq[Byte]) : BlockHeader = RawBlockHeaderSerializer.read(bytes) def fromBytes(bytes : Seq[Byte]) : BlockHeader = RawBlockHeaderSerializer.read(bytes)
def apply(bytes : Seq[Byte]) : BlockHeader = fromBytes(bytes) def apply(bytes : Seq[Byte]) : BlockHeader = fromBytes(bytes)
} }

View file

@ -95,6 +95,7 @@ sealed trait ChainParams {
*/ */
def createGenesisBlock(timestamp : String, scriptPubKey : ScriptPubKey, time : Long, nonce : Long, nBits : Long, def createGenesisBlock(timestamp : String, scriptPubKey : ScriptPubKey, time : Long, nonce : Long, nBits : Long,
version : Int, amount : CurrencyUnit) : Block = { version : Int, amount : CurrencyUnit) : Block = {
val timestampHex = timestamp.toCharArray.map(_.toByte) val timestampHex = timestamp.toCharArray.map(_.toByte)
//see https://bitcoin.stackexchange.com/questions/13122/scriptsig-coinbase-structure-of-the-genesis-block //see https://bitcoin.stackexchange.com/questions/13122/scriptsig-coinbase-structure-of-the-genesis-block
//for a full breakdown of the genesis block & its script signature //for a full breakdown of the genesis block & its script signature

View file

@ -53,5 +53,4 @@ class ChainParamsTest extends FlatSpec with MustMatchers {
genesisTransaction.txId.hex must be ("4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b") genesisTransaction.txId.hex must be ("4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b")
} }
} }