block

package
v0.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2018 License: Unlicense, Unlicense Imports: 2 Imported by: 0

Documentation

Overview

A library for working with blocks of the Parallelcoin DUO token ledger

Index

Constants

View Source
const (
	// ModeValid means a block is valid
	ModeValid = iota
	// ModeInvalid means a block is invalid
	ModeInvalid
	// ModeError means there was an error in the block
	ModeError
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	Transactions []tx.Transaction
	MerkleTree   []*Uint.U256
}

type CoinStats

type CoinStats struct {
	Height                         int
	HashBlock                      Uint.U256
	Txs, TxOutputs, SerializedSize uint64
	HashSerialized                 Uint.U256
	TotalAmount                    uint64
}

CoinStats stores the current state of the currency

type CoinsView

type CoinsView struct{}

CoinsView is

type CoinsViewBacked

type CoinsViewBacked struct {
	// contains filtered or unexported fields
}

CoinsViewBacked is

type CoinsViewCache

type CoinsViewCache struct {
	IndexTip   Index
	CacheCoins map[*Uint.U256]tx.Coins
}

CoinsViewCache is

type CoinsViewMemPool

type CoinsViewMemPool struct {
	MemPool tx.MemPool
}

CoinsViewMemPool is

type Contents

type Contents struct {
	Txs        []tx.Transaction
	MerkleTree []Uint.U256
}

type DiskIndex

type DiskIndex struct {
	Index
	HashPrev Uint.U256
}

type FileInfo

type FileInfo struct {
	Blocks, Size, UndoSize, HeightFirst, HeightLast uint
	TimeFirst, TimeLast                             uint64
}

FileInfo stores details about the blockchain on disk

type Header struct {
	CurrentVersion, Version       int
	HashPrevBlock, HashMerkleRoot Uint.U256
	Time, Bits, Nonce             uint
	Contents
}

type Index

type Index struct {
	HashBlock                     Uint.U256
	Prev                          *Index
	Height, File                  int
	DataPos, UndoPos              uint
	ChainWork                     Uint.U256
	TxCount, TxCumulative, Status uint
	Version                       int
	HashMerkleRoot                Uint.U256
	Time, Bits, Nonce             uint
}
var (
	// ChainIndex is a centralised index of a server's chain
	ChainIndex Index
)

type Locator

type Locator struct {
	Have []Uint.U256
}

Locator allows you to quickly find a block

type MerkleBlock

type MerkleBlock struct {
	Header Header
}

MerkleBlock is

type MerkleTx

type MerkleTx struct {
	tx.Transaction
	HashBlock    Uint.U256
	MerkleBranch []*Uint.U256
	Index        int
	Verified     bool
}

MerkleTx is

type PartialMerkleTree

type PartialMerkleTree struct {
	Transactions uint
	Bits         []bool
	Hash         []Uint.U256
	Bad          bool
}

PartialMerkleTree is

type ScriptCheck

type ScriptCheck struct {
	ScriptPubKey        tx.Script
	To                  tx.Transaction
	In, Flags, HashType uint
}

ScriptCheck tracks the verification of scripts

type Template

type Template struct {
	Block          Block
	TxFees, SigOps []int64
}

type Undo

type Undo struct {
	Txs tx.Undo
}

type ValidationState

type ValidationState struct {
	Mode int
	DoS  int
}

ValidationState stores the state of validation of a block

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL