Skip to content

Commit ca77ad6

Browse files
committed
refactor: remove token-taken auto-switch logic
NFT hit is permanently disabled — all token IDs are equal mining channels. No more "taken" status or auto-switching.
1 parent b61d873 commit ca77ad6

1 file changed

Lines changed: 0 additions & 15 deletions

File tree

internal/miner/loop.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"fmt"
88
"io"
99
"log/slog"
10-
"math/rand"
1110
"net/http"
1211
"strconv"
1312
"strings"
@@ -211,20 +210,6 @@ func (m *Miner) Run(ctx context.Context) error {
211210
continue
212211
}
213212

214-
// Handle token taken — auto-switch to a random available token and keep mining
215-
if resp.IDStatus == "taken" {
216-
oldToken := m.TokenID
217-
// Pick a random token in [25, 1024] different from the current one
218-
for m.TokenID == oldToken {
219-
m.TokenID = 25 + rand.Intn(1000)
220-
}
221-
ts := time.Now().Format("15:04:05")
222-
fmt.Printf(i18n.Tr("\n[%s] Token #%d is taken — auto-switching to #%d\n",
223-
"\n[%s] Token #%d 已被占用,自动切换到 #%d\n"), ts, oldToken, m.TokenID)
224-
m.emit("control", fmt.Sprintf("Token #%d taken, switched to #%d", oldToken, m.TokenID), nil)
225-
continue
226-
}
227-
228213
// Guard: catch unhandled server errors that shouldn't fall through to success.
229214
if resp.ErrorCode() != "" {
230215
slog.Warn("unhandled server error, retrying", "error", resp.ErrorCode(), "message", resp.ErrorMessage())

0 commit comments

Comments
 (0)