Skip to content

Commit

Permalink
fixup! wallet: add fee rate estimation to FundRawTx
Browse files Browse the repository at this point in the history
  • Loading branch information
YusukeShimizu committed Jul 28, 2024
1 parent a973fab commit d1e54b5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions wallet/elementsrpcwallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ package wallet
import (
"errors"
"fmt"

"math"
"strings"

"github.com/elementsproject/glightning/gelements"
"github.com/elementsproject/peerswap/log"
"github.com/elementsproject/peerswap/swap"
"github.com/vulpemventures/go-elements/address"
"github.com/vulpemventures/go-elements/elementsutil"
Expand Down Expand Up @@ -119,6 +121,10 @@ const (
func (r *ElementsRpcWallet) getFeeRate() float64 {
feeRes, err := r.rpcClient.EstimateFee(LiquidTargetBlocks, "ECONOMICAL")
if err != nil || len(feeRes.Errors) > 0 {
log.Debugf("Error estimating fee: %v", err)
if len(feeRes.Errors) > 0 {
log.Debugf(" Errors encountered during fee estimation process: %v", feeRes.Errors)
}
// Return the minimum fee rate in case of an error
return minFeeRateBTCPerKb
}
Expand Down

0 comments on commit d1e54b5

Please sign in to comment.