Skip to content

Commit

Permalink
report bitcoin fee in sat/byte instead of stas/KB
Browse files Browse the repository at this point in the history
  • Loading branch information
brewmaster012 committed Oct 9, 2023
1 parent 4ab0843 commit 329b172
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions zetaclient/bitcoin_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,8 @@ func (ob *BitcoinChainClient) PostGasPrice() error {
return fmt.Errorf("error getting gas price: %s", feeResult.Errors)
}
gasPrice := big.NewFloat(0)
gasPriceU64, _ := gasPrice.Mul(big.NewFloat(*feeResult.FeeRate), big.NewFloat(1e8)).Uint64()
// feerate from RPC is BTC/KB, convert it to satoshi/byte
gasPriceU64, _ := gasPrice.Mul(big.NewFloat(*feeResult.FeeRate), big.NewFloat(1e5)).Uint64()
bn, err := ob.rpcClient.GetBlockCount()
if err != nil {
return err
Expand All @@ -467,8 +468,6 @@ func (ob *BitcoinChainClient) PostGasPrice() error {
return err
}
_ = zetaHash
//ob.logger.WatchGasPrice.Debug().Msgf("PostGasPrice zeta tx: %s", zetaHash)
_ = feeResult
return nil
}

Expand Down

0 comments on commit 329b172

Please sign in to comment.