Skip to content

Commit

Permalink
patch: make pitch initial offset leaner
Browse files Browse the repository at this point in the history
  • Loading branch information
micahkendall committed Sep 5, 2024
1 parent b4fd000 commit 5ab434e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/blaze-tx/src/tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1263,7 +1263,9 @@ export class TxBuilder {
// Gather all inputs from the transaction body.
const inputs = [...this.body.inputs().values()];
// Perform initial checks and preparations for coin selection.
let excessValue = this.getPitch(5_000_000n);
const preliminaryDraftTx = new Transaction(this.body, new TransactionWitnessSet());
const preliminaryFee = this.params.minFeeConstant + fromHex(preliminaryDraftTx.toCbor()).length * this.params.minFeeCoefficient;
let excessValue = this.getPitch(bigintMax(BigInt(Math.ceil(preliminaryFee)), this.minimumFee));
let spareInputs: TransactionUnspentOutput[] = [];
for (const [utxo] of this.utxos.entries()) {
if (!inputs.includes(utxo.input())) {
Expand Down

0 comments on commit 5ab434e

Please sign in to comment.