OSDN Git Service

update the init block bits
[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 == 0 {
33                 return initialBlockSubsidy
34         }
35         return baseSubsidy >> uint(height/subsidyReductionInterval)
36 }
37
38 func InitBlock() []byte {
39         return []byte("0301000000000000000000000000000000000000000000000000000000000000000000d9a9c883f72b408b6eb2c2fb757ece7d5b7bf36c978e2edeb5ff98a4e8cccfa0cc8b1ed6cacdfd492159980684155da19e87de0d1b37b35c1a1123770ec1dcc710aabe77607cceacb68c0293fcb680808080801e0107010700d9a9c883f72b000001012cffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8080ccdee2a69fb314010151000000")
40 }