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:
1 parent
9034f85b88
commit
3e02ea11ef
7 files changed
+239
-23
No files matched your search
+9
-2
@@ -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