mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-12-06 02:41:29 +01:00
rpcserver: add self-node check in OpenChannelSync
This commit is contained in:
@@ -1867,6 +1867,12 @@ func (r *rpcServer) OpenChannelSync(ctx context.Context,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Making a channel to ourselves wouldn't be of any use, so we
|
||||||
|
// explicitly disallow them.
|
||||||
|
if nodePubKey.IsEqual(r.server.identityPriv.PubKey()) {
|
||||||
|
return nil, fmt.Errorf("cannot open channel to self")
|
||||||
|
}
|
||||||
|
|
||||||
localFundingAmt := btcutil.Amount(in.LocalFundingAmount)
|
localFundingAmt := btcutil.Amount(in.LocalFundingAmount)
|
||||||
remoteInitialBalance := btcutil.Amount(in.PushSat)
|
remoteInitialBalance := btcutil.Amount(in.PushSat)
|
||||||
minHtlcIn := lnwire.MilliSatoshi(in.MinHtlcMsat)
|
minHtlcIn := lnwire.MilliSatoshi(in.MinHtlcMsat)
|
||||||
|
|||||||
Reference in New Issue
Block a user