diff --git a/chainstate/client_options.go b/chainstate/client_options.go index c0b8dcab..6af26ec6 100644 --- a/chainstate/client_options.go +++ b/chainstate/client_options.go @@ -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, diff --git a/chainstate/mock_minercraft.go b/chainstate/mock_minercraft.go index 69c92f53..c69ddb4f 100644 --- a/chainstate/mock_minercraft.go +++ b/chainstate/mock_minercraft.go @@ -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 diff --git a/model_transactions.go b/model_transactions.go index 8094ea08..ec258434 100644 --- a/model_transactions.go +++ b/model_transactions.go @@ -4,6 +4,7 @@ import ( "context" "encoding/hex" "errors" + "github.com/BuxOrg/bux/chainstate" "github.com/BuxOrg/bux/notifications" "github.com/BuxOrg/bux/taskmanager" @@ -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, ) @@ -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) }