Skip to content

Commit 3cc44cc

Browse files
committed
Minimize mining fee %6
1 parent 6669c14 commit 3cc44cc

File tree

3 files changed

+54
-61
lines changed

3 files changed

+54
-61
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"eslint": "^9.24.0",
2626
"prettier": "^3.5.3",
2727
"typescript": "^5.8.3",
28-
"typescript-eslint": "^8.29.0"
28+
"typescript-eslint": "^8.29.1"
2929
},
3030
"dependencies": {
3131
"@ckb-lumos/base": "^0.23.0",

pnpm-lock.yaml

Lines changed: 51 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -562,15 +562,8 @@ function addChange(
562562
({ tx, freeCkb } = addCkbChange(
563563
tx,
564564
accountLock,
565-
(txWithDummyChange: TransactionSkeletonType) => {
566-
const baseFee = calculateTxFee(
567-
txSize(addPlaceholders(txWithDummyChange)),
568-
feeRate,
569-
);
570-
// Use a fee that is multiple of N=1249
571-
const N = 1249n;
572-
return ((baseFee + (N - 1n)) / N) * N;
573-
},
565+
(txWithDummyChange: TransactionSkeletonType) =>
566+
calculateTxFee(txSize(addPlaceholders(txWithDummyChange)), feeRate),
574567
config,
575568
));
576569

0 commit comments

Comments
 (0)