Documentation
¶
Overview ¶
storage for: 1. pending transactions that are waiting to be verified 2. verified transactions that are waiting to be confirmed
Index ¶
- Constants
- func CheckGrantBalance(grant *transactionrecord.ShareGrant) (uint64, error)
- func CheckSwapBalances(swap *transactionrecord.ShareSwap) (uint64, uint64, error)
- func ClearSpend()
- func DeleteByLink(link merkle.Digest)
- func DeleteByTxId(txId merkle.Digest)
- func Disable()
- func Enable()
- func FetchVerified(count int) ([]merkle.Digest, []byte, error)
- func Finalise() error
- func Initialise(reservoirDataFile string) error
- func ReadCounters() (int, int)
- func Rescan()
- func ScaledDifficulty(count int) *difficulty.Difficulty
- func SetTransferVerified(payId pay.PayId, detail *PaymentDetail)
- type BalanceInfo
- type GrantInfo
- type IssueInfo
- type PayNonce
- type PaymentDetail
- type PaymentSegment
- type SwapInfo
- type TrackingStatus
- type TransactionState
- type TransferInfo
Constants ¶
const (
MaximumIssues = 100 // maximum allowable issues per block
)
various limiting constants
Variables ¶
This section is empty.
Functions ¶
func CheckGrantBalance ¶ added in v0.10.0
func CheckGrantBalance(grant *transactionrecord.ShareGrant) (uint64, error)
func CheckSwapBalances ¶ added in v0.10.0
func CheckSwapBalances(swap *transactionrecord.ShareSwap) (uint64, uint64, error)
func DeleteByLink ¶ added in v0.3.5
remove a record using a link id
func DeleteByTxId ¶ added in v0.3.5
remove a record using a transaction id note, remove one issue in a block removes the whole issue block
func FetchVerified ¶ added in v0.3.5
fetch a series of verified transactions
func Rescan ¶ added in v0.9.1
func Rescan()
before calling Enable may need to run rescan to drop any invalidated transactions especially if the block height has changed
func ScaledDifficulty ¶ added in v0.3.30
func ScaledDifficulty(count int) *difficulty.Difficulty
produce a scaled difficulty based on the number of items in a block to be processed and include a quantity discount
func SetTransferVerified ¶ added in v0.5.0
func SetTransferVerified(payId pay.PayId, detail *PaymentDetail)
set verified if transaction found, otherwise preserv payment for later
Types ¶
type BalanceInfo ¶ added in v0.10.0
type BalanceInfo struct { Confirmed uint64 `json:"confirmed"` Spend uint64 `json:"spend"` Available uint64 `json:"available"` }
result returned by store share
func ShareBalance ¶ added in v0.10.0
func ShareBalance(owner *account.Account, startShareId merkle.Digest, count int) ([]BalanceInfo, error)
get a list of balances
type GrantInfo ¶ added in v0.10.0
type GrantInfo struct { Remaining uint64 Id pay.PayId TxId merkle.Digest Packed []byte Payments []transactionrecord.PaymentAlternative }
result returned by store share
func StoreGrant ¶ added in v0.10.0
func StoreGrant(grant *transactionrecord.ShareGrant) (*GrantInfo, bool, error)
type IssueInfo ¶ added in v0.3.5
type IssueInfo struct { TxIds []merkle.Digest Packed []byte Id pay.PayId Nonce PayNonce Difficulty *difficulty.Difficulty Payments []transactionrecord.PaymentAlternative }
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 pending 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
type PayNonce ¶ added in v0.3.30
type PayNonce [8]byte
type to represent a payment nonce Note: no reversal is required for this
func PayNonceFromBlock ¶ added in v0.10.1
get a previous paynonce
func (PayNonce) GoString ¶ added in v0.3.30
convert a binary pay nonce to big endian hex string for use by the fmt package (for %#v)
func (PayNonce) MarshalText ¶ added in v0.3.30
convert pay nonce to big endian hex text
func (PayNonce) String ¶ added in v0.3.30
convert a binary pay nonce to big endian hex string for use by the fmt package (for %s)
func (*PayNonce) UnmarshalText ¶ added in v0.3.30
convert little endian hex text into a pay nonce
type PaymentDetail ¶ added in v0.5.0
type PaymentSegment ¶ added in v0.5.0
type PaymentSegment [currency.Count]*transactionrecord.Payment
a single segment of a payment e.g. for an issue or transfer block owner
type SwapInfo ¶ added in v0.10.0
type SwapInfo struct { RemainingOne uint64 RemainingTwo uint64 Id pay.PayId TxId merkle.Digest Packed []byte Payments []transactionrecord.PaymentAlternative }
result returned by store share
type TrackingStatus ¶ added in v0.3.30
type TrackingStatus int
result of track payment/try proof
const ( TrackingNotFound TrackingStatus = iota TrackingAccepted TrackingStatus = iota TrackingProcessed TrackingStatus = iota TrackingInvalid TrackingStatus = iota )
possible status values
func TryProof ¶ added in v0.3.30
func TryProof(payId pay.PayId, clientNonce []byte) TrackingStatus
instead of paying, try a proof from the client nonce
func (TrackingStatus) MarshalText ¶ added in v0.3.30
func (ts TrackingStatus) MarshalText() ([]byte, error)
convert the tracking value for JSON
func (TrackingStatus) String ¶ added in v0.3.30
func (ts TrackingStatus) String() string
convert the tracking value for printf
func (*TrackingStatus) UnmarshalText ¶ added in v0.3.30
func (ts *TrackingStatus) UnmarshalText(s []byte) error
convert the tracking value from JSON to enumeration
type TransactionState ¶ added in v0.3.30
type TransactionState int
status
const ( StateUnknown TransactionState = iota StatePending TransactionState = iota StateVerified TransactionState = iota StateConfirmed TransactionState = iota )
func TransactionStatus ¶ added in v0.3.30
func TransactionStatus(txId merkle.Digest) TransactionState
get status of a transaction
func (TransactionState) String ¶ added in v0.3.30
func (state TransactionState) String() string
type TransferInfo ¶ added in v0.3.5
type TransferInfo struct { Id pay.PayId TxId merkle.Digest IssueTxId merkle.Digest Packed []byte Payments []transactionrecord.PaymentAlternative }
result returned by store transfer
func StoreTransfer ¶ added in v0.3.5
func StoreTransfer(transfer transactionrecord.BitmarkTransfer) (*TransferInfo, bool, error)