Skip to content

Commit

Permalink
fix btc large fee (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangjun725 authored Oct 28, 2020
1 parent c2d735c commit 0748f18
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/BTC/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ export class BTC implements UtxoCoin {
}
}

public async generateTransaction(txData: TxData, signers: KeyProvider[], disableLargeFee = true) {
public async generateTransaction(txData: TxData, signers: KeyProvider[], disableLargeFee = false) {
const psbtBuilder = new PsbtBuilder(this.network);
const psbt = psbtBuilder
.addInputsForPsbt(txData, disableLargeFee)
Expand Down Expand Up @@ -298,7 +298,7 @@ export class BTC implements UtxoCoin {
return this.extractTx(psbt);
};

public generateTransactionSync(txData: TxData, signers: KeyProviderSync[], disableLargeFee= true) {
public generateTransactionSync(txData: TxData, signers: KeyProviderSync[], disableLargeFee= false) {
const psbtBuilder = new PsbtBuilder(this.network);
const psbt = psbtBuilder
.addInputsForPsbt(txData, disableLargeFee)
Expand Down Expand Up @@ -407,7 +407,7 @@ export class BTC implements UtxoCoin {
return `${r}${s}`;
};

public generatePsbt = (txData: TxData, disableLargeFee= true): string => {
public generatePsbt = (txData: TxData, disableLargeFee= false): string => {
const psbtBuilder = new PsbtBuilder(this.network);
const psbt = psbtBuilder
.addInputsForPsbt(txData, disableLargeFee)
Expand Down
4 changes: 2 additions & 2 deletions src/BTC/txBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default class PsbtBuilder {
this.psbt = new bitcoin.Psbt({network});
}

public addInputsForPsbt = (txData: TxData, disableLargeFee = true) => {
public addInputsForPsbt = (txData: TxData, disableLargeFee = false) => {
if (this.verifyInput(txData, disableLargeFee)) {
txData.inputs.forEach(eachInput => {
return this.addInputForPsbt(eachInput);
Expand Down Expand Up @@ -166,7 +166,7 @@ export default class PsbtBuilder {

private verifyInput = (
txData: TxData | MultiSignTxData,
disableLargeFee = true,
disableLargeFee = false,
) => {
const totalInputs = this.calculateTotalInputs(txData);
if (this.isDestinationOutputs(txData.outputs)) {
Expand Down

0 comments on commit 0748f18

Please sign in to comment.