You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
loop/loopdb/interface.go

28 lines
833 B
Go

package loopdb
import (
"time"
"github.com/lightningnetwork/lnd/lntypes"
)
// SwapStore is the priamry database interface used by the loopd system. It
// houses informatino for all pending completed/failed swaps.
type SwapStore interface {
// FetchUnchargeSwaps returns all swaps currently in the store.
FetchUnchargeSwaps() ([]*PersistentUncharge, error)
// CreateUncharge adds an initiated swap to the store.
CreateUncharge(hash lntypes.Hash, swap *UnchargeContract) error
// UpdateUncharge stores a swap updateUncharge. This appends to the
// event log for a particular swap as it goes through the various
// stages in its lifetime.
UpdateUncharge(hash lntypes.Hash, time time.Time, state SwapState) error
// Close closes the underlying database.
Close() error
}
// TODO(roasbeef): back up method in interface?