mirror of https://github.com/BTCPrivate/lnd.git
lnwallet: switch LightningChannel struct to use channeldb instead of raw namespace
This commit is contained in:
parent
890ceecc1a
commit
0307f321ad
|
@ -10,7 +10,6 @@ import (
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/btcsuite/btcd/wire"
|
||||||
"github.com/btcsuite/btcutil"
|
"github.com/btcsuite/btcutil"
|
||||||
"github.com/btcsuite/btcutil/txsort"
|
"github.com/btcsuite/btcutil/txsort"
|
||||||
"github.com/btcsuite/btcwallet/walletdb"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -28,7 +27,7 @@ type LightningChannel struct {
|
||||||
// commitment update, plus some other meta-data...Or just use OP_RETURN
|
// commitment update, plus some other meta-data...Or just use OP_RETURN
|
||||||
// to help out?
|
// to help out?
|
||||||
// currently going for: nSequence/nLockTime overloading
|
// currently going for: nSequence/nLockTime overloading
|
||||||
channelNamespace walletdb.Namespace
|
channelDB *ChannelDB
|
||||||
|
|
||||||
// stateMtx protects concurrent access to the state struct.
|
// stateMtx protects concurrent access to the state struct.
|
||||||
stateMtx sync.RWMutex
|
stateMtx sync.RWMutex
|
||||||
|
@ -44,13 +43,13 @@ type LightningChannel struct {
|
||||||
|
|
||||||
// newLightningChannel...
|
// newLightningChannel...
|
||||||
func newLightningChannel(wallet *LightningWallet, events *chainntnfs.ChainNotifier,
|
func newLightningChannel(wallet *LightningWallet, events *chainntnfs.ChainNotifier,
|
||||||
dbNamespace walletdb.Namespace, state OpenChannelState) (*LightningChannel, error) {
|
chanDB *ChannelDB, state OpenChannelState) (*LightningChannel, error) {
|
||||||
|
|
||||||
return &LightningChannel{
|
return &LightningChannel{
|
||||||
wallet: wallet,
|
wallet: wallet,
|
||||||
channelEvents: events,
|
channelEvents: events,
|
||||||
channelNamespace: dbNamespace,
|
channelDB: chanDB,
|
||||||
channelState: state,
|
channelState: state,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue