Skip to content

Commit

Permalink
Quo() -> Div()
Browse files Browse the repository at this point in the history
  • Loading branch information
wizeguyy authored and kiltsonfire committed May 15, 2024
1 parent 5da0539 commit 4141ac5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion consensus/blake3pow/poem.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func (blake3pow *Blake3pow) WorkShareLogS(wo *types.WorkObject) (*big.Int, error
cBigBits := blake3pow.IntrinsicLogS(powHash)
thresholdBigBits := blake3pow.IntrinsicLogS(common.BytesToHash(target.Bytes()))
wsEntropy = new(big.Int).Sub(thresholdBigBits, cBigBits)
extraBits := new(big.Int).Quo(wsEntropy, new(big.Int).Exp(big.NewInt(2), big.NewInt(int64(mantBits)), nil))
extraBits := new(big.Int).Div(wsEntropy, new(big.Int).Exp(big.NewInt(2), big.NewInt(int64(mantBits)), nil))
wsEntropy = new(big.Int).Div(wsEntropy, new(big.Int).Exp(big.NewInt(2), new(big.Int).Add(extraBits, big.NewInt(1)), nil))
} else {
wsEntropy = new(big.Int).Set(blake3pow.IntrinsicLogS(powHash))
Expand Down
2 changes: 1 addition & 1 deletion consensus/progpow/poem.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func (progpow *Progpow) WorkShareLogS(wo *types.WorkObject) (*big.Int, error) {
cBigBits := progpow.IntrinsicLogS(powHash)
thresholdBigBits := progpow.IntrinsicLogS(common.BytesToHash(target.Bytes()))
wsEntropy = new(big.Int).Sub(thresholdBigBits, cBigBits)
extraBits := new(big.Int).Quo(wsEntropy, new(big.Int).Exp(big.NewInt(2), big.NewInt(int64(mantBits)), nil))
extraBits := new(big.Int).Div(wsEntropy, new(big.Int).Exp(big.NewInt(2), big.NewInt(int64(mantBits)), nil))
wsEntropy = new(big.Int).Div(wsEntropy, new(big.Int).Exp(big.NewInt(2), new(big.Int).Add(extraBits, big.NewInt(1)), nil))
} else {
wsEntropy = new(big.Int).Set(progpow.IntrinsicLogS(powHash))
Expand Down

0 comments on commit 4141ac5

Please sign in to comment.