mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-30 02:21:08 +02:00
rpcserver: skip calculating fee rate for PSBT funding
This commit is contained in:
13
rpcserver.go
13
rpcserver.go
@ -2130,17 +2130,22 @@ func (r *rpcServer) parseOpenChannelReq(in *lnrpc.OpenChannelRequest,
|
|||||||
return nil, fmt.Errorf("cannot open channel to self")
|
return nil, fmt.Errorf("cannot open channel to self")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var feeRate chainfee.SatPerKWeight
|
||||||
|
|
||||||
|
// Skip estimating fee rate for PSBT funding.
|
||||||
|
if in.FundingShim == nil || in.FundingShim.GetPsbtShim() == nil {
|
||||||
// Calculate an appropriate fee rate for this transaction.
|
// Calculate an appropriate fee rate for this transaction.
|
||||||
feeRate, err := lnrpc.CalculateFeeRate(
|
feeRate, err = lnrpc.CalculateFeeRate(
|
||||||
uint64(in.SatPerByte), in.SatPerVbyte, // nolint:staticcheck
|
uint64(in.SatPerByte), in.SatPerVbyte,
|
||||||
uint32(in.TargetConf), r.server.cc.FeeEstimator,
|
uint32(in.TargetConf), r.server.cc.FeeEstimator,
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
rpcsLog.Debugf("[openchannel]: using fee of %v sat/kw for funding tx",
|
rpcsLog.Debugf("[openchannel]: using fee of %v sat/kw for "+
|
||||||
int64(feeRate))
|
"funding tx", int64(feeRate))
|
||||||
|
}
|
||||||
|
|
||||||
script, err := chancloser.ParseUpfrontShutdownAddress(
|
script, err := chancloser.ParseUpfrontShutdownAddress(
|
||||||
in.CloseAddress, r.cfg.ActiveNetParams.Params,
|
in.CloseAddress, r.cfg.ActiveNetParams.Params,
|
||||||
|
Reference in New Issue
Block a user