Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouop0 committed Dec 13, 2023
1 parent ef577b3 commit 239a1ca
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions bitcoin/commiter_service.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package bitcoin

import (
"encoding/binary"
"strconv"
"time"

dbm "github.com/tendermint/tm-db"
Expand All @@ -12,7 +12,7 @@ import (
const (
BitcoinServiceName = "BitcoinCommitterService"

WaitTimeout = 1 * time.Minute
WaitTimeout = 10 * time.Minute
)

// CommitterService is a service that commits bitcoin transactions.
Expand Down Expand Up @@ -48,7 +48,11 @@ func (bis *CommitterService) OnStart() error {
continue
}
if blockNumMax != nil {
index = int64(binary.BigEndian.Uint64(blockNumMax))
index, err = strconv.ParseInt(string(blockNumMax), 10, 64)
if err != nil {
bis.Logger.Error("Failed to parse blockNumMax", "err", err)
continue
}
}

roots, err := GetStateRoot(bis.committer.stateConfig, index)

Check failure on line 58 in bitcoin/commiter_service.go

View workflow job for this annotation

GitHub Actions / Run golangci-lint

ineffectual assignment to err (ineffassign)

Check warning

Code scanning / CodeQL

Useless assignment to local variable Warning

This definition of err is never used.
Expand Down Expand Up @@ -94,10 +98,8 @@ func (bis *CommitterService) OnStart() error {
bis.Logger.Info("inscriptions," + inscriptions[i])
}
bis.Logger.Info("fees:", "fee", fees)

buf := make([]byte, 8)
binary.BigEndian.PutUint64(buf, uint64(index))
err = bis.db.Set([]byte("blockNumMax"), buf)
indexStr := strconv.FormatInt(index, 10)
err = bis.db.Set([]byte("blockNumMax"), []byte(indexStr))
if err != nil {
bis.Logger.Error("Failed to set blockNumMax", "err", err)
continue
Expand Down

0 comments on commit 239a1ca

Please sign in to comment.