Ensure that private and public channels have different capacity

This commit is contained in:
Yaacov Akiba Slama
2021-03-16 10:55:35 +02:00
parent 78b9f2fdc4
commit 76f51e2ba7
2 changed files with 6 additions and 3 deletions

View File

@@ -52,6 +52,9 @@ func isConnected(ctx context.Context, client lnrpc.LightningClient, destination
func openChannel(ctx context.Context, client lnrpc.LightningClient, paymentHash, destination []byte, incomingAmountMsat int64) ([]byte, uint32, error) {
capacity := incomingAmountMsat/1000 + additionalChannelCapacity
if capacity == publicChannelAmount {
capacity++
}
channelPoint, err := client.OpenChannelSync(ctx, &lnrpc.OpenChannelRequest{
NodePubkey: destination,
LocalFundingAmount: capacity,