@@ -10,6 +10,7 @@ import (
10
10
"github.com/lightninglabs/taproot-assets/tapcfg"
11
11
"github.com/lightninglabs/taproot-assets/taprpc"
12
12
"github.com/lightninglabs/taproot-assets/taprpc/mintrpc"
13
+ "github.com/lightningnetwork/lnd/lnwallet/chainfee"
13
14
"github.com/urfave/cli"
14
15
)
15
16
50
51
groupByGroupName = "by_group"
51
52
assetIDName = "asset_id"
52
53
shortResponseName = "short"
53
- feeRateName = "fee_rate "
54
+ feeRateName = "sat_per_vbyte "
54
55
assetAmountName = "amount"
55
56
burnOverrideConfirmationName = "override_confirmation_destroy_assets"
56
57
)
@@ -261,7 +262,7 @@ var finalizeBatchCommand = cli.Command{
261
262
},
262
263
cli.Uint64Flag {
263
264
Name : feeRateName ,
264
- Usage : "if set, the fee rate in sat/kw to use for " +
265
+ Usage : "if set, the fee rate in sat/vB to use for " +
265
266
"the minting transaction" ,
266
267
},
267
268
},
@@ -270,11 +271,20 @@ var finalizeBatchCommand = cli.Command{
270
271
271
272
func parseFeeRate (ctx * cli.Context ) (uint32 , error ) {
272
273
if ctx .IsSet (feeRateName ) {
273
- feeRate := ctx .Uint64 (feeRateName )
274
- if feeRate > math .MaxUint32 {
274
+ userFeeRate := ctx .Uint64 (feeRateName )
275
+ if userFeeRate > math .MaxUint32 {
275
276
return 0 , fmt .Errorf ("fee rate exceeds 2^32" )
276
277
}
277
278
279
+ // Convert from sat/vB to sat/kw. Round up to the fee floor if
280
+ // the specified feerate is too low.
281
+ feeRate := chainfee .SatPerKVByte (userFeeRate * 1000 ).
282
+ FeePerKWeight ()
283
+
284
+ if feeRate < chainfee .FeePerKwFloor {
285
+ feeRate = chainfee .FeePerKwFloor
286
+ }
287
+
278
288
return uint32 (feeRate ), nil
279
289
}
280
290
@@ -531,7 +541,7 @@ var sendAssetsCommand = cli.Command{
531
541
},
532
542
cli.Uint64Flag {
533
543
Name : feeRateName ,
534
- Usage : "if set, the fee rate in sat/kw to use for " +
544
+ Usage : "if set, the fee rate in sat/vB to use for " +
535
545
"the anchor transaction" ,
536
546
},
537
547
// TODO(roasbeef): add arg for file name to write sender proof
0 commit comments