mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
loopdb: make new loopdb package to house persistent storage
This commit is contained in:
parent
74cf29a9cf
commit
cdcb9f8345
12 changed files with 589 additions and 442 deletions
27
loopdb/interface.go
Normal file
27
loopdb/interface.go
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
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?
|
||||
Loading…
Add table
Add a link
Reference in a new issue