OSDN Git Service

Merge branch 'dev' of https://github.com/Bytom/bytom into dev
[bytom/bytom-spv.git] / consensus / general.go
1 package consensus
2
3 import (
4         "github.com/bytom/protocol/bc"
5 )
6
7 const (
8         // define the Max transaction size and Max block size
9         MaxTxSize    = uint64(1024)
10         MaxBlockSzie = uint64(16384)
11
12         //config parameter for coinbase reward
13         subsidyReductionInterval = uint64(560640)
14         baseSubsidy              = uint64(624000000000)
15         initialBlockSubsidy      = uint64(1470000000000000000)
16
17         // config for pow mining
18         powMinBits            = uint64(2161727821138738707)
19         BlocksPerRetarget     = uint64(1024)
20         targetSecondsPerBlock = uint64(60)
21 )
22
23 // define the BTM asset id, the soul asset of Bytom
24 var BTMAssetID = &bc.AssetID{
25         V0: uint64(18446744073709551615),
26         V1: uint64(18446744073709551615),
27         V2: uint64(18446744073709551615),
28         V3: uint64(18446744073709551615),
29 }
30
31 func BlockSubsidy(height uint64) uint64 {
32         if height == 1 {
33                 return initialBlockSubsidy
34         }
35         return baseSubsidy >> uint(height/subsidyReductionInterval)
36 }
37
38 func InitBlock() []byte {
39         return []byte("0301010000000000000000000000000000000000000000000000000000000000000000cecccaebf42b406b03545ed2b38a578e5e6b0796d4ebdd8a6dd72210873fcc026c7319de578ffc492159980684155da19e87de0d1b37b35c1a1123770ec1dcc710aabe77607cced7bb1993fcb680808080801e0107010700cecccaebf42b000001012cffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8080ccdee2a69fb314010151000000")
40 }