mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-30 10:35:32 +02:00
channeldb: added isPending flag and queries
In order to facilitate persistence during the funding process, added the isPending flag to channels so that when the daemon restarts, we can properly re-initialize the chain notifier and update the state of channels that were going through the funding process.
This commit is contained in:
committed by
Olaoluwa Osuntokun
parent
9034f85b88
commit
3e02ea11ef
11
rpcserver.go
11
rpcserver.go
@ -631,7 +631,11 @@ func (r *rpcServer) GetInfo(ctx context.Context,
|
||||
activeChannels += uint32(len(serverPeer.ChannelSnapshots()))
|
||||
}
|
||||
|
||||
pendingChannels := r.server.fundingMgr.NumPendingChannels()
|
||||
pendingChannels, err := r.server.fundingMgr.NumPendingChannels()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
idPub := r.server.identityPriv.PubKey().SerializeCompressed()
|
||||
|
||||
bestHash, bestHeight, err := r.server.bio.GetBestBlock()
|
||||
@ -760,7 +764,10 @@ func (r *rpcServer) PendingChannels(ctx context.Context,
|
||||
|
||||
var pendingChannels []*lnrpc.PendingChannelResponse_PendingChannel
|
||||
if includeOpen {
|
||||
pendingOpenChans := r.server.fundingMgr.PendingChannels()
|
||||
pendingOpenChans, err := r.server.fundingMgr.PendingChannels()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, pendingOpen := range pendingOpenChans {
|
||||
channelPointStr := "<non initialized yet>"
|
||||
if pendingOpen.channelPoint != nil {
|
||||
|
Reference in New Issue
Block a user