confirmer

package
v0.0.0-...-51c274e Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAndRemoveStopwatch

func GetAndRemoveStopwatch(name string) (uint64, uint64, bool)

func GetStopwatch

func GetStopwatch(name string) (uint64, uint64, bool)

func StartStopwatch

func StartStopwatch(name string) bool

creates or reinitializes stopwatch entry. Returns false if already exist

func StopStopwatch

func StopStopwatch(name string) bool

Types

type ConfirmationMonitor

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

func NewConfirmationMonitor

func NewConfirmationMonitor(mapi multiapi.MultiAPI, nanozmq string, log *logging.Logger, aec utils.ErrorCounter) *ConfirmationMonitor

func (*ConfirmationMonitor) CancelConfirmationPolling

func (cmon *ConfirmationMonitor) CancelConfirmationPolling(bundleHash Hash)

can't be called from within OnConfirmation callback

func (*ConfirmationMonitor) OnConfirmation

func (cmon *ConfirmationMonitor) OnConfirmation(bundleHash Hash, callback func(time.Time))

type Confirmer

type Confirmer struct {
	ConfirmerParams
	// contains filtered or unexported fields
}

func NewConfirmer

func NewConfirmer(params ConfirmerParams, confMon *ConfirmationMonitor) *Confirmer

func (*Confirmer) StartConfirmerTask

func (conf *Confirmer) StartConfirmerTask(bundleTrytes []Trytes) (chan *ConfirmerUpdate, func(), error)

type ConfirmerParams

type ConfirmerParams struct {
	IotaMultiAPI          multiapi.MultiAPI
	IotaMultiAPIgTTA      multiapi.MultiAPI
	IotaMultiAPIaTT       multiapi.MultiAPI
	TxTagPromote          Trytes
	AddressPromote        Hash
	ForceReattachAfterMin uint64
	PromoteChain          bool
	PromoteEverySec       uint64
	PromoteDisable        bool
	Log                   *logging.Logger
	AEC                   utils.ErrorCounter
	SlowDownThreshold     int
	ConfmonPollingOnly    bool
	ConfmonNanozmq        string
}

type ConfirmerUpdate

type ConfirmerUpdate struct {
	NumAttaches           uint64
	NumPromotions         uint64
	TotalDurationATTMsec  uint64
	TotalDurationGTTAMsec uint64
	UpdateTime            time.Time
	UpdateType            UpdateType
	PromoteTailHash       Hash
	Err                   error
}

type UpdateType

type UpdateType int
const (
	UPD_NO_ACTION UpdateType = 0
	UPD_REATTACH  UpdateType = 1
	UPD_PROMOTE   UpdateType = 2
	UPD_CONFIRM   UpdateType = 3
	UPD_FAILED    UpdateType = 4
)

func (UpdateType) ToString

func (ut UpdateType) ToString() string

Jump to

Keyboard shortcuts

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