lnrpc: add MinConfs to WalletBalanceRequest
This commit is contained in:
4 files changed
+1704
-1676
No files matched your search
+1687
-1675
File diff suppressed because it is too large.
Load diff
@@ -2847,6 +2847,11 @@ message WalletBalanceRequest {
|
|||||||
// The wallet account the balance is shown for.
|
// The wallet account the balance is shown for.
|
||||||
// If this is not specified, the balance of the "default" account is shown.
|
// If this is not specified, the balance of the "default" account is shown.
|
||||||
string account = 1;
|
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 {
|
message WalletBalanceResponse {
|
||||||
|
|||||||
@@ -64,6 +64,14 @@
|
|||||||
"in": "query",
|
"in": "query",
|
||||||
"required": false,
|
"required": false,
|
||||||
"type": "string"
|
"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": [
|
"tags": [
|
||||||
|
|||||||
+4
-1
@@ -3292,8 +3292,11 @@ func (r *rpcServer) WalletBalance(ctx context.Context,
|
|||||||
// Get confirmed balance, from txs that have >= 1 confirmations.
|
// Get confirmed balance, from txs that have >= 1 confirmations.
|
||||||
// TODO(halseth): get both unconfirmed and confirmed balance in
|
// TODO(halseth): get both unconfirmed and confirmed balance in
|
||||||
// one call, as this is racy.
|
// one call, as this is racy.
|
||||||
|
if in.MinConfs <= 0 {
|
||||||
|
in.MinConfs = 1
|
||||||
|
}
|
||||||
confirmedBal, err := r.server.cc.Wallet.ConfirmedBalance(
|
confirmedBal, err := r.server.cc.Wallet.ConfirmedBalance(
|
||||||
1, account.AccountName,
|
in.MinConfs, account.AccountName,
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
Reference in new issue
Block a user