Fix channel on miner page for unknown miners, switch order of comparisons on NextDifficulty
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
DataHoarder 2023-07-24 19:48:44 +02:00
parent 07d09286e9
commit e7e1aee11b
Signed by: DataHoarder
SSH key fingerprint: SHA256:OLTRf6Fl87G52SiR7sWLGNzlJt4WOX+tfI2yxo0z7xk
2 changed files with 5 additions and 1 deletions

View file

@ -904,6 +904,10 @@ func main() {
payouts = getSliceFromAPI[*index.Payout](fmt.Sprintf("payouts/%d?from_timestamp=%d", miner.Id, uint64(time.Now().Unix())-(consensus.ChainWindowSize*consensus.TargetBlockTime*(totalWindows+1))))
}()
wg.Wait()
} else {
sweepC := make(chan *index.MainLikelySweepTransaction)
sweeps = sweepC
close(sweepC)
}
sharesInWindow := cmdutils.NewPositionChart(30, uint64(poolInfo.SideChain.WindowSize))

View file

@ -432,7 +432,7 @@ func NextDifficulty(consensus *Consensus, timestamps []uint64, difficultyData []
for i := range difficultyData {
// Pick only the cumulative difficulty from specifically the entries that are within the timestamp upper and low bounds
if timestampLowerBound <= difficultyData[i].timestamp && difficultyData[i].timestamp <= timestampUpperBound {
if difficultyData[i].cumulativeDifficulty.Cmp(minDifficulty) < 0 {
if minDifficulty.Cmp(difficultyData[i].cumulativeDifficulty) > 0 {
minDifficulty = difficultyData[i].cumulativeDifficulty
}
if maxDifficulty.Cmp(difficultyData[i].cumulativeDifficulty) < 0 {