mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00

* Move timesorter to its own package and remove unused functions * Remove padding+genesis from BlockWindow * Adjust the difficulty even when there's less than difficultyAdjustmentWindowSize blocks * Remove unnecessary check from checkBlockTransactionsFinalized * Update tests with new pastMedianTime and Difficulty * Review nit
26 lines
356 B
Go
26 lines
356 B
Go
package math
|
|
|
|
// MinInt returns the smaller of x or y.
|
|
func MinInt(x, y int) int {
|
|
if x < y {
|
|
return x
|
|
}
|
|
return y
|
|
}
|
|
|
|
// MaxInt64 returns the bigger of x or y.
|
|
func MaxInt64(x, y int64) int64 {
|
|
if x > y {
|
|
return x
|
|
}
|
|
return y
|
|
}
|
|
|
|
// MinUint32 returns the smaller of x or y.
|
|
func MinUint32(x, y uint32) uint32 {
|
|
if x < y {
|
|
return x
|
|
}
|
|
return y
|
|
}
|