Documentation ¶
Index ¶
Constants ¶
const ( // emitted when a promotion occurred EventPromotion event.Event = 200 // emitted when a reattachment occurred EventReattachment event.Event = 201 )
own emitted events
Variables ¶
var ErrUnableToPromote = errors.New("unable to promote")
var ErrUnableToReattach = errors.New("unable to reattach")
var ErrUnpromotableTail = errors.New("tail is unpromoteable")
Functions ¶
This section is empty.
Types ¶
type Promoter ¶
type Promoter struct {
// contains filtered or unexported fields
}
Promoter is an account plugin which takes care of trying to get pending transfers to get confirmed by issuing promotion transactions and creating reattachments. The Promoter will only run one promotion/reattachment task at any given time.
func NewPromoter ¶
NewPromoter creates a new Promoter. If the interval is set to 0, the Promoter will only promote/reattach through PromoteReattach().
func (*Promoter) PromoteReattach ¶
PromoteReattach awaits the current promotion/reattachment task to finish (in case it's ongoing), pauses the task, executes a manual task, resumes the repeated task and then returns. PromoteReattach will block infinitely if called after the account has been shutdown.
type PromotionReattachmentEvent ¶
type PromotionReattachmentEvent struct { // The tail tx hash of the first bundle broadcasted to the network. OriginTailTxHash Hash `json:"original_tail_tx_hash"` // The bundle hash of the promoted/reattached bundle. BundleHash Hash `json:"bundle_hash"` // The tail tx hash of the promotion transaction. PromotionTailTxHash Hash `json:"promotion_tail_tx_hash"` // The tail tx hash of the reattached bundle. ReattachmentTailTxHash Hash `json:"reattachment_tail_tx_hash"` }
PromotionReattachmentEvent is emitted when a promotion or reattachment happened.