Documentation ¶
Overview ¶
Package utxodb implements UTXO selection and reservation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInsufficient indicates the account doesn't contain enough // units of the requested asset to satisfy the reservation. // New units must be deposited into the account in order to // satisfy the request; change will not be sufficient. ErrInsufficient = errors.New("reservation found insufficient funds") // ErrReserved indicates that a reservation could not be // satisfied because some of the outputs were already reserved. // When those reservations are finalized into a transaction // (and no other transaction spends funds from the account), // new change outputs will be created // in sufficient amounts to satisfy the request. ErrReserved = errors.New("reservation found outputs already reserved") )
Functions ¶
func ExpireReservations ¶
ExpireReservations is meant to be run as a goroutine. It loops, calling the expire_reservations() pl/pgsql function to remove expired reservations from the reservations table. It returns when its context is canceled.
Types ¶
type Change ¶
Change represents reserved units beyond what was asked for. Total reservation is for Amount+Source.Amount.
Click to show internal directories.
Click to hide internal directories.