lnrpc: add MinConfs to WalletBalanceRequest

This commit is contained in:
Marcos committed 2023-12-01 18:22:35 +01:00
1 parent f87e370efd
commit 90b5037d73
4 files changed
+1704 -1676

No files matched your search

+1687 -1675
View File
File diff suppressed because it is too large. Load diff
+5
View File
@@ -2847,6 +2847,11 @@ message WalletBalanceRequest {
// The wallet account the balance is shown for.
// If this is not specified, the balance of the "default" account is shown.
string account = 1;
// The minimum number of confirmations each one of your outputs used for the
// funding transaction must satisfy. If this is not specified, the default
// value of 1 is used.
int32 min_confs = 2;
}
message WalletBalanceResponse {
+8
View File
@@ -64,6 +64,14 @@
"in": "query",
"required": false,
"type": "string"
},
{
"name": "min_confs",
"description": "The minimum number of confirmations each one of your outputs used for the\nfunding transaction must satisfy. If this is not specified, the default\nvalue of 1 is used.",
"in": "query",
"required": false,
"type": "integer",
"format": "int32"
}
],
"tags": [
+4 -1
View File
@@ -3292,8 +3292,11 @@ func (r *rpcServer) WalletBalance(ctx context.Context,
// Get confirmed balance, from txs that have >= 1 confirmations.
// TODO(halseth): get both unconfirmed and confirmed balance in
// one call, as this is racy.
if in.MinConfs <= 0 {
in.MinConfs = 1
}
confirmedBal, err := r.server.cc.Wallet.ConfirmedBalance(
1, account.AccountName,
in.MinConfs, account.AccountName,
)
if err != nil {
return nil, err