From 48b16a1c5c37def6cf2255d5f95d9b2cb8ff5fc8 Mon Sep 17 00:00:00 2001 From: Boris Nagaev Date: Tue, 18 Mar 2025 15:44:16 -0300 Subject: [PATCH] walletrpc: document that min conf_target is 2 Without this notice a developer might think that 1 is a valid value, which can result in a rare bug. Example: https://github.com/lightninglabs/loop/issues/898 --- lnrpc/walletrpc/walletkit.pb.go | 2 ++ lnrpc/walletrpc/walletkit.proto | 2 ++ lnrpc/walletrpc/walletkit.swagger.json | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lnrpc/walletrpc/walletkit.pb.go b/lnrpc/walletrpc/walletkit.pb.go index 23b423caac..dcd522f947 100644 --- a/lnrpc/walletrpc/walletkit.pb.go +++ b/lnrpc/walletrpc/walletkit.pb.go @@ -2708,6 +2708,7 @@ type EstimateFeeRequest struct { unknownFields protoimpl.UnknownFields // The number of confirmations to shoot for when estimating the fee. + // Must be greater than 1. ConfTarget int32 `protobuf:"varint,1,opt,name=conf_target,json=confTarget,proto3" json:"conf_target,omitempty"` } @@ -3901,6 +3902,7 @@ type isFundPsbtRequest_Fees interface { type FundPsbtRequest_TargetConf struct { // The target number of blocks that the transaction should be confirmed in. + // Must be greater than 1. TargetConf uint32 `protobuf:"varint,3,opt,name=target_conf,json=targetConf,proto3,oneof"` } diff --git a/lnrpc/walletrpc/walletkit.proto b/lnrpc/walletrpc/walletkit.proto index 32d1fde07e..29f056b302 100644 --- a/lnrpc/walletrpc/walletkit.proto +++ b/lnrpc/walletrpc/walletkit.proto @@ -841,6 +841,7 @@ message SendOutputsResponse { message EstimateFeeRequest { /* The number of confirmations to shoot for when estimating the fee. + Must be greater than 1. */ int32 conf_target = 1; } @@ -1396,6 +1397,7 @@ message FundPsbtRequest { oneof fees { /* The target number of blocks that the transaction should be confirmed in. + Must be greater than 1. */ uint32 target_conf = 3; diff --git a/lnrpc/walletrpc/walletkit.swagger.json b/lnrpc/walletrpc/walletkit.swagger.json index baa284f7ef..d343366510 100644 --- a/lnrpc/walletrpc/walletkit.swagger.json +++ b/lnrpc/walletrpc/walletkit.swagger.json @@ -325,7 +325,7 @@ "parameters": [ { "name": "conf_target", - "description": "The number of confirmations to shoot for when estimating the fee.", + "description": "The number of confirmations to shoot for when estimating the fee.\nMust be greater than 1.", "in": "path", "required": true, "type": "integer", @@ -1577,7 +1577,7 @@ "target_conf": { "type": "integer", "format": "int64", - "description": "The target number of blocks that the transaction should be confirmed in." + "description": "The target number of blocks that the transaction should be confirmed in.\nMust be greater than 1." }, "sat_per_vbyte": { "type": "string",