Documentation ¶
Overview ¶
Package collect contains routines for collecting data from the Bitcoin network, which is then used by package estimate.
Index ¶
- func PruneLowFee(entries map[string]MempoolEntry, thresh sim.FeeRate)
- func SimifyMempool(entries map[string]MempoolEntry) ([]*sim.Tx, error)
- type Block
- type BlockGetter
- type BlockStatDB
- type Collector
- type Config
- type MempoolEntry
- type MempoolState
- type MempoolStateDiff
- type MempoolStateGetter
- type TxDB
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PruneLowFee ¶
func PruneLowFee(entries map[string]MempoolEntry, thresh sim.FeeRate)
Remove mempool entries with a feerate lower than thresh, along with its descendants.
func SimifyMempool ¶
func SimifyMempool(entries map[string]MempoolEntry) ([]*sim.Tx, error)
SimifyMempool converts the mempool data in mempoolState into the form expected by Sim. We check here that the mempool is closed; i.e. that all parents listed in a tx's "depends" field are also in the mempool.
Types ¶
type BlockGetter ¶
type BlockStatDB ¶
type Collector ¶
type Collector struct { S <-chan *MempoolState B <-chan []Block E <-chan error // contains filtered or unexported fields }
NOTE: S,B,E channels must be serviced.
func NewCollector ¶
func NewCollector(tdb TxDB, bdb BlockStatDB, cfg Config) *Collector
func (*Collector) State ¶
func (c *Collector) State() *MempoolState
NOTE: state can be nil, if getState returns errors.
type Config ¶
type Config struct { PollPeriod int `yaml:"pollperiod" json:"pollperiod"` GetState MempoolStateGetter `yaml:"-" json:"-"` GetBlock BlockGetter `yaml:"-" json:"-"` Logger *log.Logger `yaml:"-" json:"-"` }
type MempoolEntry ¶
type MempoolState ¶
type MempoolState struct { Height int64 `json:"height"` Entries map[string]MempoolEntry `json:"entries"` Time int64 `json:"time"` MinFeeRate sim.FeeRate `json:"minfeerate"` }
func (*MempoolState) Copy ¶
func (s *MempoolState) Copy() *MempoolState
func (*MempoolState) SizeFn ¶
func (s *MempoolState) SizeFn() sim.MonotonicFn
func (*MempoolState) String ¶
func (s *MempoolState) String() string
func (*MempoolState) Sub ¶
func (s *MempoolState) Sub(t *MempoolState) *MempoolStateDiff
type MempoolStateDiff ¶
type MempoolStateDiff struct { Height int64 Entries map[string]MempoolEntry Time int64 }
type MempoolStateGetter ¶
type MempoolStateGetter func() (*MempoolState, error)
Click to show internal directories.
Click to hide internal directories.