mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-12 14:12:27 +02:00
rpcserver: error on zero local balance in openchan req
In this commit, we catch and error on the specific case where an openchannel request has a zero-value local funding amount. This is just to ensure that the error message returned makes more sense.
This commit is contained in:
@ -1913,6 +1913,11 @@ func (r *rpcServer) parseOpenChannelReq(in *lnrpc.OpenChannelRequest,
|
||||
|
||||
globalFeatureSet := r.server.featureMgr.Get(feature.SetNodeAnn)
|
||||
|
||||
// Ensure that a local funding amount has been specified.
|
||||
if localFundingAmt == 0 {
|
||||
return nil, fmt.Errorf("local funding amount must be non-zero")
|
||||
}
|
||||
|
||||
// Ensure that the initial balance of the remote party (if pushing
|
||||
// satoshis) does not exceed the amount the local party has requested
|
||||
// for funding.
|
||||
|
Reference in New Issue
Block a user