Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No fee input added if deductFee is set to false and tx amount matches an account utxo #133

Open
dashameter opened this issue Feb 9, 2021 · 9 comments
Labels
wallet-lib Wallet lib related

Comments

@dashameter
Copy link
Contributor

Consider a tx with the option deductFee: false and an amount of e.g. 2e6:

    const transaction = client.account.createTransaction({
      deductFee: false,
      recipients: [
        {
          recipient: "y...",
          satoshis: 2e6,
        },
      ],
    })

If the account has an UTXO with 2e6 the default strategy will select that sole input, apparently unaware of the deductFee: false option. As a result:

{code: 3, message: "invalid transaction: min relay fee not met, 0 < 192 (code 66). Code:-26", metadata: {…}}

is thrown since no additional input is added to cover the fee.

@dashameter
Copy link
Contributor Author

@Alex-Werner are we tracking this bug to be fixed in one of the upcoming releases or shall we bounty it out to the incubator?

@Alex-Werner
Copy link
Contributor

It is tracked, it is groomed, and it is planned ready for being work on.
Initial work about this one is that basically, we will return a proper error, as the use case here is to pay without specifying any fees and refusing the system to deduct fees by himselves.
Such usage could be when after using the automatic UTXO selection, a user would want to decide of a specific input for payment.
Without such modification, transaction will then have a single utxo as sole input, with single recipient, and no fees, therefore, it won't met the min relay fee and won't be proceeded.

Our way to "fix" that situation is by explaining to the user within broadcastTransaction in a min fee check that it won't be broadcastable.
I don't think there is need to bounty that out, and we plan (as far as I know, still waiting confirmation) to have this fixed for v21.

@SamKirby22
Copy link

Discussed in Triage - P1, Maverick to discuss with Alex.

@dash-maverick
Copy link

It's closed. Please reopen in case you notice anything suspicious.

@dash-maverick
Copy link

Please retest

@dashameter
Copy link
Contributor Author

currently getting

 InvalidRequestError: 9 FAILED_PRECONDITION: Transaction is rejected: tx-txlock-conflict (code 16)

@dash-maverick
Copy link

@Alex-Werner please refer

@shumkov shumkov transferred this issue from dashevo/wallet-lib Dec 15, 2021
@shumkov shumkov added the wallet-lib Wallet lib related label Dec 15, 2021
@dashameter
Copy link
Contributor Author

retest failed:

InvalidRequestError: Transaction is rejected: min relay fee not met, 0 < 340 (code 66)

@dash-maverick
Copy link

What in fact is the purpose of deduct_fee flag in that case?
fyi @markin-io

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wallet-lib Wallet lib related
Projects
None yet
Development

No branches or pull requests

5 participants