mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-02 19:44:03 +02:00
rpcserver: allow targeting open channels via global lightning ID
This commit adds the ability to open channels according a node’s “global” lightning ID in addition to the local relative peer ID.
This commit is contained in:
11
rpcserver.go
11
rpcserver.go
@ -196,18 +196,17 @@ func (r *rpcServer) OpenChannel(in *lnrpc.OpenChannelRequest,
|
||||
|
||||
localFundingAmt := btcutil.Amount(in.LocalFundingAmount)
|
||||
remoteFundingAmt := btcutil.Amount(in.RemoteFundingAmount)
|
||||
target := in.TargetPeerId
|
||||
numConfs := in.NumConfs
|
||||
updateChan, errChan := r.server.OpenChannel(target, localFundingAmt,
|
||||
remoteFundingAmt, numConfs)
|
||||
updateChan, errChan := r.server.OpenChannel(in.TargetPeerId,
|
||||
in.TargetNode, localFundingAmt, remoteFundingAmt, in.NumConfs)
|
||||
|
||||
var outpoint wire.OutPoint
|
||||
out:
|
||||
for {
|
||||
select {
|
||||
case err := <-errChan:
|
||||
rpcsLog.Errorf("unable to open channel to peerid(%v): %v",
|
||||
target, err)
|
||||
rpcsLog.Errorf("unable to open channel to "+
|
||||
"lightningID(%v) nor peerID(%v): %v",
|
||||
in.TargetNode, in.TargetPeerId, err)
|
||||
return err
|
||||
case fundingUpdate := <-updateChan:
|
||||
rpcsLog.Tracef("[openchannel] sending update: %v",
|
||||
|
Reference in New Issue
Block a user