Skip to content

Commit

Permalink
add missing file
Browse files Browse the repository at this point in the history
  • Loading branch information
jrick committed Mar 20, 2024
1 parent b265da2 commit a091a92
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions mixing/expiry.go
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
}

0 comments on commit a091a92

Please sign in to comment.