From 329b172ea76144bfecf40dd22ab8ab6c9e4d3d4c Mon Sep 17 00:00:00 2001 From: brewmaster012 <88689859+brewmaster012@users.noreply.github.com> Date: Mon, 9 Oct 2023 10:47:56 -0500 Subject: [PATCH] report bitcoin fee in sat/byte instead of stas/KB --- zetaclient/bitcoin_client.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/zetaclient/bitcoin_client.go b/zetaclient/bitcoin_client.go index c2a306ff32..1be3c61f63 100644 --- a/zetaclient/bitcoin_client.go +++ b/zetaclient/bitcoin_client.go @@ -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 @@ -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 }