Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
chore: Fixed linter issues and cleaned up gci
Browse files Browse the repository at this point in the history
  • Loading branch information
mrz1836 committed Aug 7, 2023
1 parent 10b837d commit c05ff0e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
8 changes: 4 additions & 4 deletions chainstate/client_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ func defaultClientOptions() *clientOptions {
config: &syncConfig{
httpClient: nil,
minercraftConfig: &minercraftConfig{
broadcastMiners: bm,
queryMiners: qm,
minerAPIs: apis,
broadcastMiners: bm,
queryMiners: qm,
minerAPIs: apis,
minercraftFeeQuotes: true,
feeUnit: DefaultFee,
feeUnit: DefaultFee,
},
minercraft: nil,
network: MainNet,
Expand Down
4 changes: 2 additions & 2 deletions chainstate/mock_minercraft.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ func (m *MinerCraftBase) QueryTransaction(context.Context, *minercraft.Miner, st

// RemoveMiner removes a miner from the list of miners.
func (m *MinerCraftBase) RemoveMiner(miner *minercraft.Miner) bool {
for i, miner := range allMiners {
if miner.Name == miner.Name || miner.MinerID == miner.MinerID {
for i, minerFound := range allMiners {
if miner.Name == minerFound.Name || miner.MinerID == minerFound.MinerID {
allMiners[i] = allMiners[len(allMiners)-1]
allMiners = allMiners[:len(allMiners)-1]
return true
Expand Down
8 changes: 2 additions & 6 deletions model_transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"encoding/hex"
"errors"

"github.com/BuxOrg/bux/chainstate"
"github.com/BuxOrg/bux/notifications"
"github.com/BuxOrg/bux/taskmanager"
Expand Down Expand Up @@ -984,7 +985,6 @@ func processTransactions(ctx context.Context, maxTransactions int, opts ...Model

// processTransaction will process the sync transaction record, or save the failure
func processTransaction(ctx context.Context, transaction *Transaction) error {
var txInfo *chainstate.TransactionInfo
txInfo, err := transaction.Client().Chainstate().QueryTransactionFastest(
ctx, transaction.ID, chainstate.RequiredOnChain, defaultQueryTxTimeout,
)
Expand All @@ -998,9 +998,5 @@ func processTransaction(ctx context.Context, transaction *Transaction) error {
transaction.BlockHash = txInfo.BlockHash
transaction.BlockHeight = uint64(txInfo.BlockHeight)

if err := transaction.Save(ctx); err != nil {
return err
}

return nil
return transaction.Save(ctx)
}

0 comments on commit c05ff0e

Please sign in to comment.