leaves

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthLeaves = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowLeaves   = fmt.Errorf("proto: integer overflow")
)

Functions

func CheckAddTxn

func CheckAddTxn(s *setting.Setting, newest bool, b *bolt.Bucket, resolvedtxs ...*tx.Transaction) error

CheckAddTxn checks trs and leaves if these are leaves and add them.

func Get

func Get(newest bool, n int) []tx.Hash

Get gets n random leaves. if <=0, it returns all leaves.

func GetAllAccepted

func GetAllAccepted() []tx.Hash

GetAllAccepted gets all accepted leaves after sorting.

func GetAllNewest

func GetAllNewest() []tx.Hash

GetAllNewest gets all newest leaves after sorting.

func Init

func Init(s *setting.Setting) error

Init loads leaves from DB.

func Load

func Load(s *setting.Setting) error

Load loads leaves from DB.

func Size

func Size(newest bool) int

Size return # of leave

Types

type Leaves

type Leaves struct {
	Newest   []github_com_AidosKuneen_aklib_tx.Hash `protobuf:"bytes,1,rep,name=newest,proto3,casttype=github.com/AidosKuneen/aklib/tx.Hash" json:"newest,omitempty"`
	Accepted []github_com_AidosKuneen_aklib_tx.Hash `protobuf:"bytes,2,rep,name=accepted,proto3,casttype=github.com/AidosKuneen/aklib/tx.Hash" json:"accepted,omitempty"`
}

func NewPopulatedLeaves

func NewPopulatedLeaves(r randyLeaves, easy bool) *Leaves

func (*Leaves) Descriptor

func (*Leaves) Descriptor() ([]byte, []int)

func (*Leaves) Equal

func (this *Leaves) Equal(that interface{}) bool

func (*Leaves) Marshal

func (m *Leaves) Marshal() (dAtA []byte, err error)

func (*Leaves) MarshalTo

func (m *Leaves) MarshalTo(dAtA []byte) (int, error)

func (*Leaves) ProtoMessage

func (*Leaves) ProtoMessage()

func (*Leaves) Reset

func (m *Leaves) Reset()

func (*Leaves) Size

func (m *Leaves) Size() (n int)

func (*Leaves) String

func (m *Leaves) String() string

func (*Leaves) Unmarshal

func (m *Leaves) Unmarshal(dAtA []byte) error

func (*Leaves) XXX_DiscardUnknown

func (m *Leaves) XXX_DiscardUnknown()

func (*Leaves) XXX_Marshal

func (m *Leaves) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Leaves) XXX_Merge

func (dst *Leaves) XXX_Merge(src proto.Message)

func (*Leaves) XXX_Size

func (m *Leaves) XXX_Size() int

func (*Leaves) XXX_Unmarshal

func (m *Leaves) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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