Skip to content

Commit 7dd2a6a

Browse files
committed
better expireAt
1 parent d1fed59 commit 7dd2a6a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

server/internal/core/application/covenantless.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1917,7 +1917,9 @@ func (s *covenantlessService) getNewVtxos(round *domain.Round) []domain.Vtxo {
19171917
return nil
19181918
}
19191919

1920-
createdAt := time.Now().Unix()
1920+
now := time.Now()
1921+
createdAt := now.Unix()
1922+
expireAt := now.Add(time.Duration(s.vtxoTreeExpiry.Seconds()) * time.Second).Unix()
19211923

19221924
leaves := round.VtxoTree.Leaves()
19231925
vtxos := make([]domain.Vtxo, 0)
@@ -1941,7 +1943,7 @@ func (s *covenantlessService) getNewVtxos(round *domain.Round) []domain.Vtxo {
19411943
Amount: uint64(out.Value),
19421944
RoundTxid: round.Txid,
19431945
CreatedAt: createdAt,
1944-
ExpireAt: createdAt + s.vtxoTreeExpiry.Seconds(),
1946+
ExpireAt: expireAt,
19451947
})
19461948
}
19471949
}

0 commit comments

Comments
 (0)