Skip to content

Commit

Permalink
Update computation of expiration block height (#300)
Browse files Browse the repository at this point in the history
* PoS Spending Limits UI

* Update computation of expiration block height
  • Loading branch information
lazynina authored Feb 13, 2024
1 parent e3d1925 commit 57a488a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/account.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,8 @@ export class AccountService {
const btcDepositAddress = 'Not implemented yet';
const ethDepositAddress = 'Not implemented yet';

// days * (24 hours / day) * (60 minutes / hour) * (1 block / 5 minutes) = blocks
const numBlocksBeforeExpiration = (numDaysBeforeExpiration * 24 * 60) / 5;
// days * (24 hours / day) * (60 minutes / hour) * (60 seconds / minute) * (1 block / second) = blocks
const numBlocksBeforeExpiration = numDaysBeforeExpiration * 24 * 60 * 60;

// By default, we authorize this derived key for 8640 blocks, which is about 30 days.
const expirationBlock = blockHeight + numBlocksBeforeExpiration;
Expand Down

0 comments on commit 57a488a

Please sign in to comment.