mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-02-25 07:17:32 +01:00
Fixed merge conflicts
This commit is contained in:
commit
e1a3b2dc9f
4 changed files with 6 additions and 3 deletions
|
@ -41,7 +41,6 @@ sealed trait Block extends NetworkElement with BitcoinSLogger {
|
|||
*/
|
||||
def hash : DoubleSha256Digest = CryptoUtil.doubleSHA256(bytes)
|
||||
|
||||
|
||||
def hex = RawBlockSerializer.write(this)
|
||||
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import org.bitcoins.core.protocol.NetworkElement
|
|||
import org.bitcoins.core.serializers.blockchain.RawBlockHeaderSerializer
|
||||
import org.bitcoins.core.util.{BitcoinSLogger, Factory}
|
||||
|
||||
|
||||
/**
|
||||
* Created by chris on 5/19/16.
|
||||
* 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
|
||||
*/
|
||||
|
||||
def previousBlockHash : DoubleSha256Digest
|
||||
|
||||
/**
|
||||
|
@ -47,8 +49,8 @@ sealed trait BlockHeader extends NetworkElement with BitcoinSLogger {
|
|||
*
|
||||
* @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).
|
||||
|
@ -78,6 +80,7 @@ sealed trait BlockHeader extends NetworkElement with BitcoinSLogger {
|
|||
def nonce : Long
|
||||
|
||||
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 apply(bytes : Seq[Byte]) : BlockHeader = fromBytes(bytes)
|
||||
|
||||
}
|
|
@ -95,6 +95,7 @@ sealed trait ChainParams {
|
|||
*/
|
||||
def createGenesisBlock(timestamp : String, scriptPubKey : ScriptPubKey, time : Long, nonce : Long, nBits : Long,
|
||||
version : Int, amount : CurrencyUnit) : Block = {
|
||||
|
||||
val timestampHex = timestamp.toCharArray.map(_.toByte)
|
||||
//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
|
||||
|
|
|
@ -53,5 +53,4 @@ class ChainParamsTest extends FlatSpec with MustMatchers {
|
|||
|
||||
genesisTransaction.txId.hex must be ("4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b")
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue