mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-29 10:33:05 +02:00
htlcswitch: add test for integrated control tower
This commit is contained in:
committed by
Conner Fromknecht
parent
21fc7aa829
commit
033fd3c83d
@@ -124,14 +124,26 @@ type mockServer struct {
|
||||
|
||||
var _ lnpeer.Peer = (*mockServer)(nil)
|
||||
|
||||
func initSwitchWithDB(startingHeight uint32, db *channeldb.DB) (*Switch, error) {
|
||||
if db == nil {
|
||||
tempPath, err := ioutil.TempDir("", "switchdb")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
func initDB() (*channeldb.DB, error) {
|
||||
tempPath, err := ioutil.TempDir("", "switchdb")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
db, err = channeldb.Open(tempPath)
|
||||
db, err := channeldb.Open(tempPath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return db, err
|
||||
}
|
||||
|
||||
|
||||
func initSwitchWithDB(startingHeight uint32, db *channeldb.DB) (*Switch, error) {
|
||||
var err error
|
||||
|
||||
if db == nil {
|
||||
db, err = initDB()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user