mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-12 15:17:32 +01:00
lnd: implement new Quiesce RPC with link operation stub
This commit is contained in:
@@ -40,6 +40,10 @@ var (
|
||||
Entity: "offchain",
|
||||
Action: "write",
|
||||
}},
|
||||
"/devrpc.Dev/Quiesce": {{
|
||||
Entity: "offchain",
|
||||
Action: "write",
|
||||
}},
|
||||
}
|
||||
)
|
||||
|
||||
@@ -342,3 +346,25 @@ func (s *Server) ImportGraph(ctx context.Context,
|
||||
|
||||
return &ImportGraphResponse{}, nil
|
||||
}
|
||||
|
||||
// Quiesce initiates the quiescence process for the channel with the given
|
||||
// channel ID. This method will block until the channel is fully quiesced.
|
||||
func (s *Server) Quiesce(_ context.Context, in *QuiescenceRequest) (
|
||||
*QuiescenceResponse, error) {
|
||||
|
||||
txid, err := lnrpc.GetChanPointFundingTxid(in.ChanId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
op := wire.NewOutPoint(txid, in.ChanId.OutputIndex)
|
||||
cid := lnwire.NewChanIDFromOutPoint(*op)
|
||||
_, err = s.cfg.Switch.GetLink(cid)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// TODO(proofofkeags): Add Link operation for initiating quiescence and
|
||||
// implement the rest of this in those terms
|
||||
return nil, fmt.Errorf("TODO(proofofkeags): Implement")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user