Skip to content

Commit

Permalink
accounts: update the service's UpdateAccount method
Browse files Browse the repository at this point in the history
... to take a more strict btcutil.Amount type for the account balance
parameter.
  • Loading branch information
ellemouton committed Jan 17, 2025
1 parent 0580d9a commit 34d1f67
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion accounts/rpcserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ func (s *RPCServer) UpdateAccount(ctx context.Context,

// Ask the service to update the account.
account, err := s.service.UpdateAccount(
ctx, accountID, req.AccountBalance, req.ExpirationDate,
ctx, accountID, btcutil.Amount(req.AccountBalance),
req.ExpirationDate,
)
if err != nil {
return nil, err
Expand Down
3 changes: 2 additions & 1 deletion accounts/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"sync"
"time"

"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/chaincfg"
"github.com/lightninglabs/lndclient"
"github.com/lightningnetwork/lnd/channeldb"
Expand Down Expand Up @@ -299,7 +300,7 @@ func (s *InterceptorService) NewAccount(ctx context.Context,
// UpdateAccount writes an account to the database, overwriting the existing one
// if it exists.
func (s *InterceptorService) UpdateAccount(ctx context.Context,
accountID AccountID, accountBalance,
accountID AccountID, accountBalance btcutil.Amount,
expirationDate int64) (*OffChainBalanceAccount, error) {

s.Lock()
Expand Down

0 comments on commit 34d1f67

Please sign in to comment.