Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
Update TXO.validAt heights for InstantSend.
Browse files Browse the repository at this point in the history
  • Loading branch information
sproxet committed Oct 18, 2021
1 parent 7e82601 commit b268044
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/store/modules/Transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,10 @@ function txosFromTx(tx: Transaction): TXO[] {
const isPrivate = ['lelantus-mint', 'lelantus-jmint', 'sigma-mint'].includes(txout.scriptType)

let validAt = Infinity;
if (!tx.blockHeight) validAt = Infinity;
if (!tx.blockHeight && !tx.isInstantSendLocked) validAt = Infinity;
else if (tx.inputType == "mined") validAt = tx.blockHeight + 101;
else if (tx.inputType == 'sigma') validAt = tx.blockHeight + 6;
else if (tx.inputType == 'lelantus') validAt = tx.blockHeight + 1;
else if (isPrivate) validAt = tx.blockHeight + 1;
else if (tx.inputType == 'public' && !isPrivate) validAt = 0;
else if (!isPrivate) validAt = 0;
else if (isPrivate && tx.blockHeight) validAt = tx.blockHeight + 1;

txos.push({
blockHash: tx.blockHash,
Expand Down

0 comments on commit b268044

Please sign in to comment.