mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-01-18 21:35:24 +01:00
lnwallet: add FundingFlag parameter to InitChannelReservation
This commit is contained in:
parent
10b838e9b4
commit
fffe15f0fd
@ -137,7 +137,8 @@ type ChannelReservation struct {
|
||||
// lnwallet.InitChannelReservation interface.
|
||||
func NewChannelReservation(capacity, fundingAmt, commitFeePerKw btcutil.Amount,
|
||||
wallet *LightningWallet, id uint64, pushMSat lnwire.MilliSatoshi,
|
||||
chainHash *chainhash.Hash) (*ChannelReservation, error) {
|
||||
chainHash *chainhash.Hash,
|
||||
flags lnwire.FundingFlag) (*ChannelReservation, error) {
|
||||
|
||||
var (
|
||||
ourBalance lnwire.MilliSatoshi
|
||||
@ -219,11 +220,12 @@ func NewChannelReservation(capacity, fundingAmt, commitFeePerKw btcutil.Amount,
|
||||
ChannelConfig: &channeldb.ChannelConfig{},
|
||||
},
|
||||
partialState: &channeldb.OpenChannel{
|
||||
ChanType: chanType,
|
||||
ChainHash: *chainHash,
|
||||
IsPending: true,
|
||||
IsInitiator: initiator,
|
||||
Capacity: capacity,
|
||||
ChanType: chanType,
|
||||
ChainHash: *chainHash,
|
||||
IsPending: true,
|
||||
IsInitiator: initiator,
|
||||
ChannelFlags: flags,
|
||||
Capacity: capacity,
|
||||
LocalCommitment: channeldb.ChannelCommitment{
|
||||
LocalBalance: ourBalance,
|
||||
RemoteBalance: theirBalance,
|
||||
|
@ -108,6 +108,10 @@ type initFundingReserveMsg struct {
|
||||
// the responder as part of the initial channel creation.
|
||||
pushMSat lnwire.MilliSatoshi
|
||||
|
||||
// flags are the channel flags specified by the initiator in the
|
||||
// open_channel message.
|
||||
flags lnwire.FundingFlag
|
||||
|
||||
// err is a channel in which all errors will be sent across. Will be
|
||||
// nil if this initial set is successful.
|
||||
//
|
||||
@ -449,7 +453,7 @@ func (l *LightningWallet) InitChannelReservation(
|
||||
capacity, ourFundAmt btcutil.Amount, pushMSat lnwire.MilliSatoshi,
|
||||
commitFeePerKw, fundingFeePerWeight btcutil.Amount,
|
||||
theirID *btcec.PublicKey, theirAddr *net.TCPAddr,
|
||||
chainHash *chainhash.Hash) (*ChannelReservation, error) {
|
||||
chainHash *chainhash.Hash, flags lnwire.FundingFlag) (*ChannelReservation, error) {
|
||||
|
||||
errChan := make(chan error, 1)
|
||||
respChan := make(chan *ChannelReservation, 1)
|
||||
@ -463,6 +467,7 @@ func (l *LightningWallet) InitChannelReservation(
|
||||
commitFeePerKw: commitFeePerKw,
|
||||
fundingFeePerWeight: fundingFeePerWeight,
|
||||
pushMSat: pushMSat,
|
||||
flags: flags,
|
||||
err: errChan,
|
||||
resp: respChan,
|
||||
}
|
||||
@ -493,7 +498,8 @@ func (l *LightningWallet) handleFundingReserveRequest(req *initFundingReserveMsg
|
||||
|
||||
id := atomic.AddUint64(&l.nextFundingID, 1)
|
||||
reservation, err := NewChannelReservation(req.capacity, req.fundingAmount,
|
||||
req.commitFeePerKw, l, id, req.pushMSat, l.Cfg.NetParams.GenesisHash)
|
||||
req.commitFeePerKw, l, id, req.pushMSat,
|
||||
l.Cfg.NetParams.GenesisHash, req.flags)
|
||||
if err != nil {
|
||||
req.err <- err
|
||||
req.resp <- nil
|
||||
|
Loading…
Reference in New Issue
Block a user