Skip to content

Commit

Permalink
server/asset/doge: use feeConfs and reduce maxFeeBlocks
Browse files Browse the repository at this point in the history
  • Loading branch information
chappjc committed Nov 25, 2022
1 parent 0b10fd8 commit 3e449aa
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions server/asset/btc/btc.go
Expand Up @@ -1218,6 +1218,7 @@ func (btc *Backend) estimateFee(ctx context.Context) (satsPerB uint64, err error
} else if err != nil && !errors.Is(err, errNoFeeRate) {
btc.log.Debugf("Estimate fee failure: %v", err)
}
btc.log.Debugf("No fee estimate from node. Computing median fee rate from blocks...")

tip := btc.blockCache.tipHash()

Expand Down
2 changes: 1 addition & 1 deletion server/asset/btc/rpcclient.go
Expand Up @@ -492,7 +492,7 @@ func (rc *RPCClient) RawRequest(method string, params []json.RawMessage) (json.R
return rc.requester.RawRequest(rc.ctx, method, params)
}

// Call is used to marshal parmeters and send requests to the RPC server via
// Call is used to marshal parameters and send requests to the RPC server via
// (*rpcclient.Client).RawRequest. If `thing` is non-nil, the result will be
// marshaled into `thing`.
func (rc *RPCClient) Call(method string, args []interface{}, thing interface{}) error {
Expand Down
7 changes: 4 additions & 3 deletions server/asset/doge/doge.go
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/btcsuite/btcd/chaincfg"
)

var maxFeeBlocks = 50
var maxFeeBlocks = 16

// Driver implements asset.Driver.
type Driver struct{}
Expand Down Expand Up @@ -49,7 +49,7 @@ const (
version = 0
BipID = 3
assetName = "doge"
feeConfs = 10
feeConfs = 8
)

// NewBackend generates the network parameters and creates a ltc backend as a
Expand Down Expand Up @@ -92,7 +92,8 @@ func NewBackend(configPath string, logger dex.Logger, network dex.Network) (asse
Net: network,
ChainParams: params,
Ports: ports,
DumbFeeEstimates: true,
DumbFeeEstimates: true, // dogecoind actually has estimatesmartfee though...
FeeConfs: feeConfs,
ManualMedianFee: true,
NoCompetitionFeeRate: dexdoge.DefaultFee,
MaxFeeBlocks: maxFeeBlocks,
Expand Down
1 change: 1 addition & 0 deletions server/asset/zec/zec.go
Expand Up @@ -107,6 +107,7 @@ func NewBackend(configPath string, logger dex.Logger, network dex.Network) (asse
return zecTx.MsgTx, nil
},
DumbFeeEstimates: true,
FeeConfs: feeConfs,
ManualMedianFee: true,
BlockFeeTransactions: blockFeeTransactions,
NumericGetRawRPC: true,
Expand Down

0 comments on commit 3e449aa

Please sign in to comment.