Skip to content

Commit

Permalink
chore(*): minor cleanup (#37)
Browse files Browse the repository at this point in the history
rm unused code
  • Loading branch information
Lazar955 authored Sep 11, 2024
1 parent 1c20127 commit 3f44a0f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 25 deletions.
11 changes: 1 addition & 10 deletions btcclient/client_wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,7 @@ func (c *Client) WalletPassphrase(passphrase string, timeoutSecs int64) error {
return c.Client.WalletPassphrase(passphrase, timeoutSecs)
}

func (c *Client) DumpPrivKey(address btcutil.Address) (*btcutil.WIF, error) {
return c.Client.DumpPrivKey(address)
}

// GetHighUTXO returns the UTXO that has the highest amount
// GetHighUTXOAndSum returns the UTXO that has the highest amount
func (c *Client) GetHighUTXOAndSum() (*btcjson.ListUnspentResult, float64, error) {
utxos, err := c.ListUnspent()
if err != nil {
Expand All @@ -118,11 +114,6 @@ func (c *Client) GetHighUTXOAndSum() (*btcjson.ListUnspentResult, float64, error
return &highUTXO, sum, nil
}

// CalculateTxFee calculates tx fee based on the given fee rate (BTC/kB) and the tx size
func CalculateTxFee(feeRateAmount btcutil.Amount, size uint64) (uint64, error) {
return uint64(feeRateAmount.MulF64(float64(size) / 1024)), nil
}

func (c *Client) FundRawTransaction(tx *wire.MsgTx, opts btcjson.FundRawTransactionOpts, isWitness *bool) (*btcjson.FundRawTransactionResult, error) {
return c.Client.FundRawTransaction(tx, opts, isWitness)
}
Expand Down
15 changes: 0 additions & 15 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"github.com/btcsuite/btcd/btcutil"
"github.com/spf13/viper"
"go.uber.org/zap"
"gopkg.in/yaml.v2"
)

const (
Expand Down Expand Up @@ -132,17 +131,3 @@ func New(configFile string) (Config, error) {
return Config{}, err
}
}

func WriteSample() error {
cfg := DefaultConfig()
d, err := yaml.Marshal(&cfg)
if err != nil {
return err
}
// write to file
err = os.WriteFile("./sample-vigilante.yml", d, 0644)
if err != nil {
return err
}
return nil
}

0 comments on commit 3f44a0f

Please sign in to comment.