Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,9 @@ alice$ lncli walletbalance
# channel:
bob$ lncli walletbalance
{
"balance": 0.0001
"total_balance": "0.0001",
"confirmed_balance": "0.0001",
"unconfirmed_balance": "0"
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/grpc/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ is at the default `localhost:10009`, with an open channel between the two nodes.
```python
# Retrieve and display the wallet balance
response = stub.WalletBalance(ln.WalletBalanceRequest(witness_only=True))
print response.balance
print response.total_balance
```

#### Response-streaming RPC
Expand Down
6 changes: 3 additions & 3 deletions lnd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,7 @@ func testChannelForceClosure(net *networkHarness, t *harnessTest) {
t.Fatalf("unable to get carol's balance: %v", err)
}

carolStartingBalance := btcutil.Amount(carolBalResp.Balance * 1e8)
carolStartingBalance := btcutil.Amount(carolBalResp.ConfirmedBalance * 1e8)

ctxt, _ := context.WithTimeout(ctxb, timeout)
chanPoint := openChannelAndAssert(ctxt, t, net, net.Alice, carol,
Expand Down Expand Up @@ -1707,10 +1707,10 @@ func testChannelForceClosure(net *networkHarness, t *harnessTest) {
t.Fatalf("unable to get carol's balance: %v", err)
}
carolExpectedBalance := carolStartingBalance + pushAmt
if btcutil.Amount(carolBalResp.Balance*1e8) < carolExpectedBalance {
if btcutil.Amount(carolBalResp.ConfirmedBalance*1e8) < carolExpectedBalance {
t.Fatalf("carol's balance is incorrect: expected %v got %v",
carolExpectedBalance,
btcutil.Amount(carolBalResp.Balance*1e8))
btcutil.Amount(carolBalResp.ConfirmedBalance*1e8))
}
}

Expand Down
636 changes: 328 additions & 308 deletions lnrpc/rpc.pb.go

Large diffs are not rendered by default.

80 changes: 48 additions & 32 deletions lnrpc/rpc.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions lnrpc/rpc.proto
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ message UnlockWalletResponse {}

service Lightning {
/** lncli: `walletbalance`
WalletBalance returns the sum of all confirmed unspent outputs under control
WalletBalance returns total unspent outputs(confirmed and unconfirmed), all confirmed unspent outputs and all unconfirmed unspent outputs under control
by the wallet. This method can be modified by having the request specify
only witness outputs should be factored into the final output sum.
*/
Expand Down Expand Up @@ -995,7 +995,13 @@ message WalletBalanceRequest {
}
message WalletBalanceResponse {
/// The balance of the wallet
int64 balance = 1 [json_name = "balance"];
int64 total_balance = 1 [json_name = "total_balance"];

/// The confirmed balance of a wallet(with >= 1 confirmations)
int64 confirmed_balance = 2 [json_name = "confirmed_balance"];

/// The unconfirmed balance of a wallet(with 0 confirmations)
int64 unconfirmed_balance = 3 [json_name = "unconfirmed_balance"];
}

message ChannelBalanceRequest {
Expand Down
14 changes: 12 additions & 2 deletions lnrpc/rpc.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"paths": {
"/v1/balance/blockchain": {
"get": {
"summary": "* lncli: `walletbalance`\nWalletBalance returns the sum of all confirmed unspent outputs under control\nby the wallet. This method can be modified by having the request specify\nonly witness outputs should be factored into the final output sum.",
"summary": "* lncli: `walletbalance`\nWalletBalance returns total unspent outputs(confirmed and unconfirmed), all confirmed unspent outputs and all unconfirmed unspent outputs under control\nby the wallet. This method can be modified by having the request specify\nonly witness outputs should be factored into the final output sum.",
"operationId": "WalletBalance",
"responses": {
"200": {
Expand Down Expand Up @@ -2057,10 +2057,20 @@
"lnrpcWalletBalanceResponse": {
"type": "object",
"properties": {
"balance": {
"total_balance": {
"type": "string",
"format": "int64",
"title": "/ The balance of the wallet"
},
"confirmed_balance": {
"type": "string",
"format": "int64",
"title": "/ The confirmed balance of a wallet(with \u003e= 1 confirmations)"
},
"unconfirmed_balance": {
"type": "string",
"format": "int64",
"title": "/ The unconfirmed balance of a wallet(with 0 confirmations)"
}
}
}
Expand Down
Loading