Documentation
¶
Index ¶
- Constants
- func BlockReward(complexity uint64, transactions []transaction.TX) uint64
- func HashQuality(complexity uint64) uint64
- type Block
- func (b Block) Append(tx transaction.TX) Block
- func (b Block) Bytes() []byte
- func (b Block) Compliant() bool
- func (b Block) Fingerprint() string
- func (b Block) Hash() []byte
- func (b Block) HashString() string
- func (b Block) SetBytes(data []byte) Block
- func (b Block) SetBytesFrom(source io.Reader) Block
- func (b Block) String() string
- func (b Block) SuccessorOf(prev Block) error
- func (b Block) Verify(fallback *btree.BTree) (*btree.BTree, error)
Constants ¶
View Source
const ( RewardBase uint64 = 2 << 4 HashSize = 32 VarianceChunkSize = 2 << 16 )
View Source
const (
BlockEpoch = 16.0
)
Variables ¶
This section is empty.
Functions ¶
func BlockReward ¶
func BlockReward(complexity uint64, transactions []transaction.TX) uint64
func HashQuality ¶
Types ¶
type Block ¶
type Block struct {
Chain uint64
Index uint64
Complexity uint64
Timestamp uint64
Variance uint64
PreviousHash []byte
Data []transaction.TX
}
func (Block) Compliant ¶
Compliant if the block is compliant to the hash quality requirements for this complexity step.
func (Block) Fingerprint ¶
func (Block) HashString ¶
func (Block) SuccessorOf ¶
SuccessorOf returns true if this block is the direct successor of the given block.
Click to show internal directories.
Click to hide internal directories.