Skip to content

Commit

Permalink
fix: header variable was shadowed
Browse files Browse the repository at this point in the history
Signed-off-by: hunjixin <[email protected]>
  • Loading branch information
hunjixin committed Sep 18, 2023
1 parent de28791 commit 848008b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,6 @@ github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUn
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
github.com/dominant-strategies/bn256 v0.0.0-20220930122411-fbf930a7493d h1:hkL13khTTS48QfWmjRFWpuzhOqu6S0cjpJOzPoBEDb4=
github.com/dominant-strategies/bn256 v0.0.0-20220930122411-fbf930a7493d/go.mod h1:nvtPJPChairu4o4iX2XGrstOFpLaAgNYhrUCl5bSng4=
github.com/dominant-strategies/go-quai v0.13.0-rc.0 h1:aZpS8S8KF9N9S7zagdfLMegWmp+sFSXjFuaQtWeFO/g=
github.com/dominant-strategies/go-quai v0.13.0-rc.0/go.mod h1:LQ/o4Mrx1YV/4TJK2o3fKuJIx811LpirNCk1FrrxkTQ=
github.com/dominant-strategies/go-quai v0.15.0-rc.0 h1:lfrmmSEr8KImBwY719N6LDKwVZXNY2w8U5ocYEsOpvU=
github.com/dominant-strategies/go-quai v0.15.0-rc.0/go.mod h1:LQ/o4Mrx1YV/4TJK2o3fKuJIx811LpirNCk1FrrxkTQ=
github.com/dominant-strategies/go-quai-stratum v0.1.1-0.20230411175350-8a5f55caee55 h1:TDyOiTSueb5XoQhGFK57dZZkEsQGpzGhk7ppSC9YIV0=
Expand Down
9 changes: 4 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,23 +266,22 @@ func (m *Miner) miningLoop() error {
for {
select {
case newHead := <-m.updateCh:

if header != nil && newHead.SealHash() == header.SealHash() {
continue
}

header := newHead
header = newHead
m.miningWorkRefresh.Reset(miningWorkRefreshRate)
// Mine the header here
// Return the valid header with proper nonce and mix digest
// Interrupt previous sealing operation
interrupt()
stopCh = make(chan struct{})
number := [common.HierarchyDepth]uint64{header.NumberU64(common.PRIME_CTX), header.NumberU64(common.REGION_CTX), header.NumberU64(common.ZONE_CTX)}
primeStr := fmt.Sprint(number[common.PRIME_CTX])
regionStr := fmt.Sprint(number[common.REGION_CTX])
zoneStr := fmt.Sprint(number[common.ZONE_CTX])
if number != m.previousNumber {
primeStr := fmt.Sprint(number[common.PRIME_CTX])
regionStr := fmt.Sprint(number[common.REGION_CTX])
zoneStr := fmt.Sprint(number[common.ZONE_CTX])
if number[common.PRIME_CTX] != m.previousNumber[common.PRIME_CTX] {
primeStr = color.Ize(color.Red, primeStr)
regionStr = color.Ize(color.Red, regionStr)
Expand Down

0 comments on commit 848008b

Please sign in to comment.