Skip to content

Commit 138d33b

Browse files
committed
multi: add label to account
1 parent 59563c8 commit 138d33b

File tree

7 files changed

+196
-77
lines changed

7 files changed

+196
-77
lines changed

accounts/rpcserver.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ func (s *RPCServer) CreateAccount(ctx context.Context,
5050
req *litrpc.CreateAccountRequest) (*litrpc.CreateAccountResponse,
5151
error) {
5252

53-
log.Infof("[createaccount] balance=%d, expiration=%d",
54-
req.AccountBalance, req.ExpirationDate)
53+
log.Infof("[createaccount] label=%v, balance=%d, expiration=%d",
54+
req.Label, req.AccountBalance, req.ExpirationDate)
5555

5656
var (
5757
balanceMsat lnwire.MilliSatoshi
@@ -70,7 +70,9 @@ func (s *RPCServer) CreateAccount(ctx context.Context,
7070
balanceMsat = lnwire.NewMSatFromSatoshis(balance)
7171

7272
// Create the actual account in the macaroon account store.
73-
account, err := s.service.NewAccount(balanceMsat, expirationDate, "")
73+
account, err := s.service.NewAccount(
74+
balanceMsat, expirationDate, req.Label,
75+
)
7476
if err != nil {
7577
return nil, fmt.Errorf("unable to create account: %v", err)
7678
}
@@ -196,6 +198,7 @@ func marshalAccount(acct *OffChainBalanceAccount) *litrpc.Account {
196198
Payments: make(
197199
[]*litrpc.AccountPayment, 0, len(acct.Payments),
198200
),
201+
Label: acct.Label,
199202
}
200203

201204
for hash := range acct.Invoices {

app/src/types/generated/lit-accounts_pb.d.ts

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/types/generated/lit-accounts_pb.js

Lines changed: 56 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)