Documentation ¶
Index ¶
- Constants
- Variables
- func BigToCompact(n *big.Int) uint64
- func BlockSubsidy(height uint64) uint64
- func CalcNextRequiredDifficulty(lastBH, prevBH *legacy.BlockHeader) uint64
- func CheckProofOfWork(hash *bc.Hash, bits uint64) bool
- func CompactToBig(compact uint64) *big.Int
- func HashToBig(hash *bc.Hash) *big.Int
- func InitBlock() []byte
Constants ¶
View Source
const ( // define the Max transaction size and Max block size MaxTxSize = uint64(1024) MaxBlockSzie = uint64(16384) )
Variables ¶
View Source
var BTMAssetID = &bc.AssetID{ V0: uint64(18446744073709551615), V1: uint64(18446744073709551615), V2: uint64(18446744073709551615), V3: uint64(18446744073709551615), }
define the BTM asset id, the soul asset of Bytom
Functions ¶
func BigToCompact ¶
BigToCompact converts a whole number N to a compact representation using an unsigned 64-bit number
func BlockSubsidy ¶
func CalcNextRequiredDifficulty ¶
func CalcNextRequiredDifficulty(lastBH, prevBH *legacy.BlockHeader) uint64
func CompactToBig ¶
CompactToBig converts a compact representation of a whole number N to an unsigned 64-bit number. The representation is similar to IEEE754 floating point numbers.
------------------------------------------------- | Exponent | Sign | Mantissa | ------------------------------------------------- | 8 bits [63-56] | 1 bit [55] | 55 bits [54-00] | ------------------------------------------------- N = (-1^sign) * mantissa * 256^(exponent-3)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.