Skip to content

Commit

Permalink
added some explanations for specialHandleFeeRate
Browse files Browse the repository at this point in the history
  • Loading branch information
ws4charlie committed Jul 10, 2024
1 parent 3dc39b6 commit 570fe7e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion zetaclient/chains/bitcoin/observer/observer.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,8 @@ func (ob *Observer) PostGasPrice() error {
feeRateEstimated := uint64(0)

// special handle regnet and testnet gas rate
// regnet: RPC 'EstimateSmartFee' is not available
// testnet: RPC 'EstimateSmartFee' returns unreasonable high gas rate
if ob.Chain().NetworkType != chains.NetworkType_mainnet {
feeRateEstimated, err = ob.specialHandleFeeRate()
if err != nil {
Expand Down Expand Up @@ -647,7 +649,7 @@ func (ob *Observer) LoadBroadcastedTxMap() error {
func (ob *Observer) specialHandleFeeRate() (uint64, error) {
switch ob.Chain().NetworkType {
case chains.NetworkType_privnet:
// hardcode gas price here since RPC 'EstimateSmartFee' is not available on regtest (privnet)
// hardcode gas price for regnet
return 1, nil
case chains.NetworkType_testnet:
feeRateEstimated, err := rpc.GetRecentFeeRate(ob.btcClient, ob.netParams)
Expand Down

0 comments on commit 570fe7e

Please sign in to comment.