reservoir

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2016 License: ISC Imports: 13 Imported by: 1

Documentation

Overview

Cache for transactions that have been verified

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteByLink(link merkle.Digest)

remove a record using a link id

func DeleteByTxId added in v0.3.5

func DeleteByTxId(txId merkle.Digest)

remove a record using a transaction id

func FetchVerified added in v0.3.5

func FetchVerified(count int) ([]merkle.Digest, []transactionrecord.Packed, int, error)

fetch a series of verified transactions

func Finalise

func Finalise()

stop all

func Initialise

func Initialise() error

create the cache

func Lock added in v0.3.5

func Lock()

lock down to prevent proofer from getting data

func ReadCounters added in v0.3.5

func ReadCounters() (int, int)

read counter

func SetVerified added in v0.3.5

func SetVerified(payId PayId)

move transaction(s) to verified cache

func Unlock added in v0.3.5

func Unlock()

allow proofer to run again

Types

type IssueInfo added in v0.3.5

type IssueInfo struct {
	Id     PayId
	TxIds  []merkle.Digest
	Packed []byte
}

result returned by store issues

func StoreIssues added in v0.3.5

func StoreIssues(issues []*transactionrecord.BitmarkIssue) (*IssueInfo, bool, error)

store packed record(s) in the Unverified table

return payment id and a duplicate flag

for duplicate to be true all transactions must all match exactly to a previous set - this is to allow for multiple submission from client without receiving a duplicate transaction error func Store(transactions []transactionrecord.Transaction) (*StoreInfo, bool, error) {

type PayId added in v0.3.5

type PayId [48]byte

type to represent a payment identifier this is considered as a big endian value for difficulty comparison Note: no reversal is required for this

func NewPayId added in v0.3.5

func NewPayId(packed [][]byte) PayId

create a payment identifier from a set of transactions

func (PayId) GoString added in v0.3.5

func (payid PayId) GoString() string

convert a binary pay id to big endian hex string for use by the fmt package (for %#v)

func (PayId) MarshalText added in v0.3.5

func (payid PayId) MarshalText() ([]byte, error)

convert pay id to big endian hex text

func (PayId) String added in v0.3.5

func (payid PayId) String() string

convert a binary pay id to big endian hex string for use by the fmt package (for %s)

func (*PayId) UnmarshalText added in v0.3.5

func (payid *PayId) UnmarshalText(s []byte) error

convert little endian hex text into a pay id

type TransferInfo added in v0.3.5

type TransferInfo struct {
	Id               PayId
	TxId             merkle.Digest
	Packed           []byte
	PreviousTransfer *transactionrecord.BitmarkTransfer
	OwnerData        []byte
}

result returned by store transfer

func StoreTransfer added in v0.3.5

func StoreTransfer(transfer *transactionrecord.BitmarkTransfer) (*TransferInfo, bool, error)

store a single transfer

Jump to

Keyboard shortcuts

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