ctrl

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2022 License: Unlicense Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BufferSize = 4096
)

Variables

View Source
var F, E, W, I, D, T log.LevelPrinter = log.GetLogPrinterSet(subsystem)

Functions

This section is empty.

Types

type State

type State struct {
	sync.Mutex
	// contains filtered or unexported fields
}

State stores the state of the controller

func New

func New(
	syncing *atomic.Bool,
	cfg *config.Config,
	stateCfg *active.Config,
	node *chainrpc.Node,
	connMgr chainrpc.ServerConnManager,
	mempoolUpdateChan qu.C,
	uuid uint64,
	killall qu.C,
	start, stop qu.C,
) (s *State, e error)

New creates a new controller

func (*State) GetMsgBlockTemplate

func (s *State) GetMsgBlockTemplate(
	prev *block.Block, addr btcaddr.Address,
) (mbt *templates.Message, e error)

GetMsgBlockTemplate gets a Message building on given block paying to a given address

func (*State) GetNewAddressFromWallet

func (s *State) GetNewAddressFromWallet() (addr btcaddr.Address, e error)

GetNewAddressFromWallet gets a new address from the wallet if it is connected, or returns an error

func (*State) Run

func (s *State) Run()

Run must be started as a goroutine, central routing for the business of the controller

For increased simplicity, every type of work runs in one thread, only signalling from background goroutines to trigger state changes.

func (*State) Shutdown

func (s *State) Shutdown()

Shutdown the controller

func (*State) Start

func (s *State) Start()

Start up the controller

func (*State) Stop

func (s *State) Stop()

Stop the controller

Jump to

Keyboard shortcuts

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