lnd: implement new Quiesce RPC with link operation stub

This commit is contained in:
Keagan McClelland
2024-03-12 12:16:01 -07:00
parent 99f5ca4018
commit a085b59814
3 changed files with 32 additions and 0 deletions

View File

@@ -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")
}