mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-04 09:48:19 +01:00
rpcserver: add missing channel limit check to OpenChannelSync
This commit is contained in:
parent
5660a26b60
commit
1823840ed6
1 changed files with 8 additions and 0 deletions
|
@ -1870,6 +1870,14 @@ func (r *rpcServer) OpenChannelSync(ctx context.Context,
|
||||||
"initial state must be below the local funding amount")
|
"initial state must be below the local funding amount")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ensure that the user doesn't exceed the current soft-limit for
|
||||||
|
// channel size. If the funding amount is above the soft-limit, then
|
||||||
|
// we'll reject the request.
|
||||||
|
if localFundingAmt > MaxFundingAmount {
|
||||||
|
return nil, fmt.Errorf("funding amount is too large, the max "+
|
||||||
|
"channel size is: %v", MaxFundingAmount)
|
||||||
|
}
|
||||||
|
|
||||||
// Restrict the size of the channel we'll actually open. At a later
|
// Restrict the size of the channel we'll actually open. At a later
|
||||||
// level, we'll ensure that the output we create after accounting for
|
// level, we'll ensure that the output we create after accounting for
|
||||||
// fees that a dust output isn't created.
|
// fees that a dust output isn't created.
|
||||||
|
|
Loading…
Add table
Reference in a new issue