mirror of
https://github.com/aljazceru/breez-lnd.git
synced 2025-12-18 22:54:26 +01:00
Merge pull request #2824 from wpaulino/chanid-openchannel
rpcserver: retrieve Channel ChanId from OpenChannel record
This commit is contained in:
@@ -2488,11 +2488,6 @@ func createRPCOpenChannel(r *rpcServer, graph *channeldb.ChannelGraph,
|
|||||||
nodeID := hex.EncodeToString(nodePub.SerializeCompressed())
|
nodeID := hex.EncodeToString(nodePub.SerializeCompressed())
|
||||||
chanPoint := dbChannel.FundingOutpoint
|
chanPoint := dbChannel.FundingOutpoint
|
||||||
|
|
||||||
// With the channel point known, retrieve the network channel
|
|
||||||
// ID from the database.
|
|
||||||
var chanID uint64
|
|
||||||
chanID, _ = graph.ChannelID(&chanPoint)
|
|
||||||
|
|
||||||
// Next, we'll determine whether the channel is public or not.
|
// Next, we'll determine whether the channel is public or not.
|
||||||
isPublic := dbChannel.ChannelFlags&lnwire.FFAnnounceChannel != 0
|
isPublic := dbChannel.ChannelFlags&lnwire.FFAnnounceChannel != 0
|
||||||
|
|
||||||
@@ -2527,7 +2522,7 @@ func createRPCOpenChannel(r *rpcServer, graph *channeldb.ChannelGraph,
|
|||||||
Private: !isPublic,
|
Private: !isPublic,
|
||||||
RemotePubkey: nodeID,
|
RemotePubkey: nodeID,
|
||||||
ChannelPoint: chanPoint.String(),
|
ChannelPoint: chanPoint.String(),
|
||||||
ChanId: chanID,
|
ChanId: dbChannel.ShortChannelID.ToUint64(),
|
||||||
Capacity: int64(dbChannel.Capacity),
|
Capacity: int64(dbChannel.Capacity),
|
||||||
LocalBalance: int64(localBalance.ToSatoshis()),
|
LocalBalance: int64(localBalance.ToSatoshis()),
|
||||||
RemoteBalance: int64(remoteBalance.ToSatoshis()),
|
RemoteBalance: int64(remoteBalance.ToSatoshis()),
|
||||||
|
|||||||
Reference in New Issue
Block a user