-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright (c) 2023-2024 The Decred developers | ||
// Use of this source code is governed by an ISC | ||
// license that can be found in the LICENSE file. | ||
|
||
package mixing | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/decred/dcrd/chaincfg/v3" | ||
) | ||
|
||
// MaxExpiry returns the maximum allowed expiry for a new pair request message | ||
// created with a blockchain tip at tipHeight. | ||
func MaxExpiry(tipHeight uint32, params *chaincfg.Params) uint32 { | ||
target := params.TargetTimePerBlock | ||
return tipHeight + uint32(2*time.Hour/target) + 1 | ||
} |