Documentation ¶
Index ¶
Constants ¶
View Source
const DIFFICULTY = 12
Variables ¶
This section is empty.
Functions ¶
func CalHashSha256 ¶
func CalMerkleNodeHash ¶
func CalMerkleRootHash ¶
Input d : list of hashes not data
func CalMerkleUpperHashs ¶
Types ¶
type Block ¶
type Block struct { Header BlockHeader Transactions []*Transaction }
func CreateBlock ¶
func CreateBlock(trs []*Transaction, prevhash []byte, height int) *Block
func CreateGenesis ¶
func (*Block) MerkleRoot ¶
type BlockHeader ¶
type BlockHeader struct { Hash []byte PrvHash []byte MerkleRoot []byte Timestamp int64 Difficulty int Nonce int Height int }
func (*BlockHeader) GetHash ¶
func (bh *BlockHeader) GetHash() []byte
type Transaction ¶
func CreateTransaction ¶
func CreateTransaction(w *wallet.Wallet, d []byte) *Transaction
func (*Transaction) GetHash ¶
func (t *Transaction) GetHash() []byte
func (*Transaction) Verify ¶
func (t *Transaction) Verify() bool
Click to show internal directories.
Click to hide internal directories.