diff --git a/cmd/v3tool/dcrwallet.go b/cmd/v3tool/dcrwallet.go index f14cf418..6b86a2ea 100644 --- a/cmd/v3tool/dcrwallet.go +++ b/cmd/v3tool/dcrwallet.go @@ -76,7 +76,7 @@ func (w *dcrwallet) createFeeTx(feeAddress string, fee int64) (string, error) { } var locked bool - unlock := false + const unlock = false err = w.Call(context.TODO(), "lockunspent", &locked, unlock, transactions) if err != nil { return "", err @@ -118,7 +118,7 @@ func (w *dcrwallet) dumpPrivKey(addr stdaddr.Address) (string, error) { func (w *dcrwallet) getTickets() (*wallettypes.GetTicketsResult, error) { var tickets wallettypes.GetTicketsResult - includeImmature := true + const includeImmature = true err := w.Call(context.TODO(), "gettickets", &tickets, includeImmature) if err != nil { return nil, err diff --git a/cmd/vspd/main.go b/cmd/vspd/main.go index bd3cd5cd..e059a65d 100644 --- a/cmd/vspd/main.go +++ b/cmd/vspd/main.go @@ -76,7 +76,7 @@ func run() int { return 1 } - writeBackup := true + const writeBackup = true defer db.Close(writeBackup) // Create a context that is cancelled when a shutdown request is received diff --git a/rpc/dcrd.go b/rpc/dcrd.go index 6342b2ba..93fa73a6 100644 --- a/rpc/dcrd.go +++ b/rpc/dcrd.go @@ -168,7 +168,7 @@ func (c *DcrdRPC) DecodeRawTransaction(txHex string) (*dcrdtypes.TxRawDecodeResu // SendRawTransaction uses sendrawtransaction RPC to broadcast a transaction to // the network. It ignores errors caused by duplicate transactions. func (c *DcrdRPC) SendRawTransaction(txHex string) error { - allowHighFees := false + const allowHighFees = false err := c.Call(c.ctx, "sendrawtransaction", nil, txHex, allowHighFees) if err != nil { @@ -238,7 +238,7 @@ func (c *DcrdRPC) GetBestBlockHeader() (*dcrdtypes.GetBlockHeaderVerboseResult, // GetBlockHeaderVerbose uses getblockheader RPC with verbose=true to retrieve // the header of the requested block. func (c *DcrdRPC) GetBlockHeaderVerbose(blockHash string) (*dcrdtypes.GetBlockHeaderVerboseResult, error) { - verbose := true + const verbose = true var blockHeader dcrdtypes.GetBlockHeaderVerboseResult err := c.Call(c.ctx, "getblockheader", &blockHeader, blockHash, verbose) if err != nil { diff --git a/rpc/dcrwallet.go b/rpc/dcrwallet.go index b86cffb0..672dda94 100644 --- a/rpc/dcrwallet.go +++ b/rpc/dcrwallet.go @@ -170,9 +170,9 @@ func (c *WalletRPC) WalletInfo() (*wallettypes.WalletInfoResult, error) { // AddTicketForVoting uses importprivkey RPC, followed by addtransaction RPC, to // add a new ticket to a voting wallet. func (c *WalletRPC) AddTicketForVoting(votingWIF, blockHash, txHex string) error { - label := "imported" - rescan := false - scanFrom := 0 + const label = "imported" + const rescan = false + const scanFrom = 0 err := c.Call(c.ctx, "importprivkey", nil, votingWIF, label, rescan, scanFrom) if err != nil { return fmt.Errorf("importprivkey failed: %w", err)