mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-22 06:21:40 +01:00
rpcserver: skip calculating fee rate for PSBT funding
This commit is contained in:
parent
519a8749ef
commit
61e9c11881
1 changed files with 15 additions and 10 deletions
25
rpcserver.go
25
rpcserver.go
|
@ -2130,17 +2130,22 @@ func (r *rpcServer) parseOpenChannelReq(in *lnrpc.OpenChannelRequest,
|
|||
return nil, fmt.Errorf("cannot open channel to self")
|
||||
}
|
||||
|
||||
// Calculate an appropriate fee rate for this transaction.
|
||||
feeRate, err := lnrpc.CalculateFeeRate(
|
||||
uint64(in.SatPerByte), in.SatPerVbyte, // nolint:staticcheck
|
||||
uint32(in.TargetConf), r.server.cc.FeeEstimator,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var feeRate chainfee.SatPerKWeight
|
||||
|
||||
rpcsLog.Debugf("[openchannel]: using fee of %v sat/kw for funding tx",
|
||||
int64(feeRate))
|
||||
// Skip estimating fee rate for PSBT funding.
|
||||
if in.FundingShim == nil || in.FundingShim.GetPsbtShim() == nil {
|
||||
// Calculate an appropriate fee rate for this transaction.
|
||||
feeRate, err = lnrpc.CalculateFeeRate(
|
||||
uint64(in.SatPerByte), in.SatPerVbyte,
|
||||
uint32(in.TargetConf), r.server.cc.FeeEstimator,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
rpcsLog.Debugf("[openchannel]: using fee of %v sat/kw for "+
|
||||
"funding tx", int64(feeRate))
|
||||
}
|
||||
|
||||
script, err := chancloser.ParseUpfrontShutdownAddress(
|
||||
in.CloseAddress, r.cfg.ActiveNetParams.Params,
|
||||
|
|
Loading…
Add table
Reference in a new issue