From d6db38666315baf43f1dc80b67a8d7058615bee7 Mon Sep 17 00:00:00 2001 From: Torkel Rogstad Date: Sat, 30 Apr 2022 10:37:54 +0200 Subject: [PATCH] chainrpc: clarify documentation Clarify the comment on RegisterConfirmationsNtfn. The output script is in fact mandatory, not optional. --- docs/release-notes/release-notes-0.15.0.md | 3 +++ lnrpc/chainrpc/chainnotifier.proto | 8 +++++--- lnrpc/chainrpc/chainnotifier.swagger.json | 2 +- lnrpc/chainrpc/chainnotifier_grpc.pb.go | 16 ++++++++++------ 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/docs/release-notes/release-notes-0.15.0.md b/docs/release-notes/release-notes-0.15.0.md index ca56fb58ae..8be494e5b3 100644 --- a/docs/release-notes/release-notes-0.15.0.md +++ b/docs/release-notes/release-notes-0.15.0.md @@ -206,6 +206,9 @@ close to continue after a peer disconnect](https://github.com/lightningnetwork/l options](https://github.com/lightningnetwork/lnd/pull/6064) to allow specifying non-default paths for the configuration and RPC cookie files. +* [Clarify comment](https://github.com/lightningnetwork/lnd/pull/6481) on + `chainnotifier.RegisterConfirmationsNtfn`. + ## RPC Server * [Add value to the field diff --git a/lnrpc/chainrpc/chainnotifier.proto b/lnrpc/chainrpc/chainnotifier.proto index 2c97ae561b..4045d81c37 100644 --- a/lnrpc/chainrpc/chainnotifier.proto +++ b/lnrpc/chainrpc/chainnotifier.proto @@ -12,9 +12,11 @@ service ChainNotifier { registers an intent for a client to be notified once a confirmation request has reached its required number of confirmations on-chain. - A client can specify whether the confirmation request should be for a - particular transaction by its hash or for an output script by specifying a - zero hash. + A confirmation request must have a valid output script. It is also possible + to give a transaction ID. If the transaction ID is not set, a notification + is sent once the output script confirms. If the transaction ID is also set, + a notification is sent once the output script confirms in the given + transaction. */ rpc RegisterConfirmationsNtfn (ConfRequest) returns (stream ConfEvent); diff --git a/lnrpc/chainrpc/chainnotifier.swagger.json b/lnrpc/chainrpc/chainnotifier.swagger.json index ec224b6ba0..a1c4b1d2c5 100644 --- a/lnrpc/chainrpc/chainnotifier.swagger.json +++ b/lnrpc/chainrpc/chainnotifier.swagger.json @@ -62,7 +62,7 @@ "/v2/chainnotifier/register/confirmations": { "post": { "summary": "RegisterConfirmationsNtfn is a synchronous response-streaming RPC that\nregisters an intent for a client to be notified once a confirmation request\nhas reached its required number of confirmations on-chain.", - "description": "A client can specify whether the confirmation request should be for a\nparticular transaction by its hash or for an output script by specifying a\nzero hash.", + "description": "A confirmation request must have a valid output script. It is also possible\nto give a transaction ID. If the transaction ID is not set, a notification\nis sent once the output script confirms. If the transaction ID is also set,\na notification is sent once the output script confirms in the given\ntransaction.", "operationId": "ChainNotifier_RegisterConfirmationsNtfn", "responses": { "200": { diff --git a/lnrpc/chainrpc/chainnotifier_grpc.pb.go b/lnrpc/chainrpc/chainnotifier_grpc.pb.go index c04140d1b4..9b96db4c9e 100644 --- a/lnrpc/chainrpc/chainnotifier_grpc.pb.go +++ b/lnrpc/chainrpc/chainnotifier_grpc.pb.go @@ -23,9 +23,11 @@ type ChainNotifierClient interface { //registers an intent for a client to be notified once a confirmation request //has reached its required number of confirmations on-chain. // - //A client can specify whether the confirmation request should be for a - //particular transaction by its hash or for an output script by specifying a - //zero hash. + //A confirmation request must have a valid output script. It is also possible + //to give a transaction ID. If the transaction ID is not set, a notification + //is sent once the output script confirms. If the transaction ID is also set, + //a notification is sent once the output script confirms in the given + //transaction. RegisterConfirmationsNtfn(ctx context.Context, in *ConfRequest, opts ...grpc.CallOption) (ChainNotifier_RegisterConfirmationsNtfnClient, error) // //RegisterSpendNtfn is a synchronous response-streaming RPC that registers an @@ -161,9 +163,11 @@ type ChainNotifierServer interface { //registers an intent for a client to be notified once a confirmation request //has reached its required number of confirmations on-chain. // - //A client can specify whether the confirmation request should be for a - //particular transaction by its hash or for an output script by specifying a - //zero hash. + //A confirmation request must have a valid output script. It is also possible + //to give a transaction ID. If the transaction ID is not set, a notification + //is sent once the output script confirms. If the transaction ID is also set, + //a notification is sent once the output script confirms in the given + //transaction. RegisterConfirmationsNtfn(*ConfRequest, ChainNotifier_RegisterConfirmationsNtfnServer) error // //RegisterSpendNtfn is a synchronous response-streaming RPC that registers an