block

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2016 License: ISC Imports: 20 Imported by: 0

Documentation

Overview

current block data

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CRC added in v0.2.0

func CRC(height uint64, packed []byte) uint64

crc a block digest

func CreateOwnership added in v0.2.0

func CreateOwnership(issueTxId merkle.Digest, issueBlockNumber uint64, assetIndex transactionrecord.AssetIndex, newOwner *account.Account)

func DeleteDownToBlock added in v0.2.0

func DeleteDownToBlock(finalBlockNumber uint64) error

delete from current highest block down to and including the specified block

func DigestForBlock added in v0.2.0

func DigestForBlock(number uint64) (blockdigest.Digest, error)

func Finalise

func Finalise() error

shudown the block system

func Get

func Get() (blockdigest.Digest, uint64)

get block data for initialising a new block returns: previous block digest and the number for the new block

func GetHeight added in v0.2.0

func GetHeight() uint64

get the current height

func GetLatestCRC added in v0.2.0

func GetLatestCRC() uint64

fetch latest crc value

func GetPayment added in v0.2.0

func GetPayment(blockNumberKey []byte) *transactionrecord.Payment

get a payment record from a specific block given the blocks 8 byte big endian key

func Initialise

func Initialise() error

setup the current block data

func OwnerOf added in v0.2.0

func OwnerOf(txId merkle.Digest) *account.Account

find the owner of a specific transaction (only issue or transfer is allowed)

func StoreIncoming added in v0.2.0

func StoreIncoming(packedBlock []byte) error

store an incoming block checking to make sure it is valid first

func TransferOwnership added in v0.2.0

func TransferOwnership(previousTxId merkle.Digest, transferTxId merkle.Digest, transferBlockNumber uint64, currentOwner *account.Account, newOwner *account.Account)

need to have a lock

func VerifyTransfer added in v0.2.0

verify that a transfer is ok

Types

type Ownership added in v0.2.0

type Ownership struct {
	N          uint64                       `json:"n,string"`
	TxId       merkle.Digest                `json:"txId"`
	IssueTxId  merkle.Digest                `json:"issue"`
	AssetIndex transactionrecord.AssetIndex `json:"index"`
}

type to represent an ownership record

func ListBitmarksFor added in v0.2.0

func ListBitmarksFor(owner *account.Account, start uint64, count int) ([]Ownership, error)

fetch a list of bitmarks for an owner

type RingReader added in v0.2.0

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

to iterate though the ring

func NewRingReader added in v0.2.0

func NewRingReader() *RingReader

start of ring iterator

func (*RingReader) Get added in v0.2.0

func (r *RingReader) Get() (uint64, bool)

fetch item from ring works in reverse, fetching older items

Jump to

Keyboard shortcuts

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