// Manages the complete lifecycle of a buy. // When a bool can be read from interrupt, the buy is aborted. func (a *BuyActivity) PerformBuy(log bitwrk.Logger, interrupt <-chan bool, workFile cafs.File) (cafs.File, error) { a.workFile = workFile.Duplicate() file, err := a.doPerformBuy(log, interrupt) if err != nil { a.lastError = err } a.alive = false return file, err }