Documentation ¶
Index ¶
- Variables
- type FeeManager
- func (fm *FeeManager) AddFee(address types.UnlockHash, amount types.Currency, appUID modules.AppUID, ...) (modules.FeeUID, error)
- func (fm *FeeManager) CancelFee(feeUID modules.FeeUID) error
- func (fm *FeeManager) Close() error
- func (fm *FeeManager) PaidFees() ([]modules.AppFee, error)
- func (fm *FeeManager) PayoutHeight() (types.BlockHeight, error)
- func (fm *FeeManager) PendingFees() ([]modules.AppFee, error)
- type PersistHeader
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // PersistFilename is the filename to be used when persisting FeeManager // information on disk PersistFilename = "feemanager.dat" // MetadataHeader defines the header for the persist file. MetadataHeader = "Fee Manager\n" // MetadataVersion defines the version for the persist file. MetadataVersion = "v1.4.9\n" )
View Source
var ( // ErrFeeNotFound is returned if a fee is not found in the FeeManager ErrFeeNotFound = errors.New("fee not found") )
View Source
var ( // PayoutInterval is the interval at which the payoutheight is set in the // future PayoutInterval = build.Select(build.Var{ Standard: types.BlocksPerMonth, Dev: types.BlocksPerDay, Testing: types.BlocksPerHour, }).(types.BlockHeight) )
Functions ¶
This section is empty.
Types ¶
type FeeManager ¶
type FeeManager struct {
// contains filtered or unexported fields
}
FeeManager is responsible for tracking any application fees that are being charged to this siad instance
func New ¶
func New(cs modules.ConsensusSet, tp modules.TransactionPool, w modules.Wallet, persistDir string) (*FeeManager, error)
New creates a new FeeManager.
func NewCustomFeeManager ¶
func NewCustomFeeManager(cs modules.ConsensusSet, tp modules.TransactionPool, w modules.Wallet, persistDir string, deps modules.Dependencies) (*FeeManager, error)
NewCustomFeeManager creates a new FeeManager using custom dependencies.
func (*FeeManager) AddFee ¶ added in v1.4.8
func (fm *FeeManager) AddFee(address types.UnlockHash, amount types.Currency, appUID modules.AppUID, recurring bool) (modules.FeeUID, error)
AddFee adds a fee to the fee manager.
func (*FeeManager) CancelFee ¶ added in v1.4.8
func (fm *FeeManager) CancelFee(feeUID modules.FeeUID) error
CancelFee cancels a fee by removing it from the FeeManager's map
func (*FeeManager) PaidFees ¶ added in v1.4.8
func (fm *FeeManager) PaidFees() ([]modules.AppFee, error)
PaidFees returns all the paid fees that are being tracked by the FeeManager
func (*FeeManager) PayoutHeight ¶ added in v1.4.8
func (fm *FeeManager) PayoutHeight() (types.BlockHeight, error)
PayoutHeight returns the nextPayoutHeight of the FeeManager
func (*FeeManager) PendingFees ¶ added in v1.4.8
func (fm *FeeManager) PendingFees() ([]modules.AppFee, error)
PendingFees returns all the pending fees that are being tracked by the FeeManager
type PersistHeader ¶ added in v1.4.8
type PersistHeader struct { // Metadata contains the persist metadata identifying the type and // version of the file. persist.Metadata // NextPayoutHeight is the height at which the next fee payout happens. NextPayoutHeight types.BlockHeight // LatestSyncedOffest is the latest offset that has a confirmed fsync, // data up to and including this point should be reliable. LatestSyncedOffset uint64 }
PersistHeader defines the data that goes at the head of the persist file.
Click to show internal directories.
Click to hide internal directories.