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

sendcoins throws "transaction output is dust" error on sending any amount of coins #2019

Closed
PWKad opened this Issue Oct 8, 2018 · 12 comments

Comments

Projects
None yet
4 participants
@PWKad
Contributor

PWKad commented Oct 8, 2018

Background

With lncli sendcoins a transaction fails, when sending using bitcoind sendtoaddress and only changing the amount it works fine.

$ lncli --network regtest sendcoins mk5Wh5gziaxh3M1kkSH1rRGc7KDrKpvkdJ 20001
[lncli] rpc error: code = Unknown desc = transaction output is dust

Your environment

  • version of lnd - v5
  • which operating system (uname -a on *Nix) - osx
  • version of btcd, bitcoind, or other backend - bitcoind
  • any other relevant environment details - regtest

Steps to reproduce

On regtest mode, when using sendcoins and supplying a valid address / amount in satoshis

$ lncli --network regtest sendcoins mk5Wh5gziaxh3M1kkSH1rRGc7KDrKpvkdJ 20001

Expected behaviour

Transaction should be created and broadcast.

Actual behaviour

Transaction is rejected

@wpaulino wpaulino self-assigned this Oct 9, 2018

@Roasbeef

This comment has been minimized.

Member

Roasbeef commented Oct 9, 2018

This is regtest, it depends on the fee rate returned. Typically the fee rate is wonky, I think atm we only ignore fees on testnet, but not also regtest.

@PWKad

This comment has been minimized.

Contributor

PWKad commented Oct 9, 2018

Is there a way to override the testnet flag so it ignores fees? I saw where getinfo only checked for testnet, if there was a way to set that externally until regtest is supported I could do that.

@halseth

This comment has been minimized.

Collaborator

halseth commented Oct 11, 2018

Try setting the fee manually with --sat_per_byte.

@PWKad

This comment has been minimized.

Contributor

PWKad commented Oct 11, 2018

I did / do try it that way but it still doesn't appear to work.

@halseth

This comment has been minimized.

Collaborator

halseth commented Oct 11, 2018

Could you provide some logs from lnd?

@PWKad

This comment has been minimized.

Contributor

PWKad commented Oct 11, 2018

Sure, as a sidenote when I set the log level to trace I don't see any additional output from lnd besides what is shown above but I'll provide a more complete log in a few

@Roasbeef

This comment has been minimized.

Member

Roasbeef commented Oct 13, 2018

This is on regtest though right? If you run estimatefee on the backing node, what response do you get for varying values? (1, 3, 6, etc)

@PWKad

This comment has been minimized.

Contributor

PWKad commented Oct 13, 2018

bitcoin@9f27fe36137f:/$ bitcoin-cli estimatefee
error code: -1
error message:
estimatefee nblocks

DEPRECATED. Please use estimatesmartfee for more intelligent estimates.
Estimates the approximate fee per kilobyte needed for a transaction to begin
confirmation within nblocks blocks. Uses virtual transaction size of transaction
as defined in BIP 141 (witness data is discounted).

Arguments:
1. nblocks     (numeric, required)

Result:
n              (numeric) estimated fee-per-kilobyte

A negative value is returned if not enough transactions and blocks
have been observed to make an estimate.
-1 is always returned for nblocks == 1 as it is impossible to calculate
a fee that is high enough to get reliably included in the next block.

and

bitcoin@9f27fe36137f:/$ bitcoin-cli estimatesmartfee 6
{
  "errors": [
    "Insufficient data or no feerate found"
  ],
  "blocks": 0
}
@PWKad

This comment has been minimized.

Contributor

PWKad commented Oct 13, 2018

And just to be sure there are not actually zero blocks -

bitcoin@9f27fe36137f:/$ bitcoin-cli getinfo
{
  "deprecation-warning": "WARNING: getinfo is deprecated and will be fully removed in 0.16. Projects should transition to using getblockchaininfo, getnetworkinfo, and getwalletinfo before upgrading to 0.16",
  "version": 150100,
  "protocolversion": 70015,
  "walletversion": 139900,
  "balance": 11837.50000000,
  "blocks": 450,
  "timeoffset": 0,
  "connections": 0,
  "proxy": "",
  "difficulty": 4.656542373906925e-10,
  "testnet": false,
  "keypoololdest": 1539374300,
  "keypoolsize": 1999,
  "paytxfee": 0.00000000,
  "relayfee": 0.00000000,
  "errors": ""
}

To be clear though I am zero percent familiar with the fee estimation system so if there are other things causing issue leading to the above issue apologies in advance.

@PWKad

This comment has been minimized.

Contributor

PWKad commented Oct 13, 2018

I lied it looked like I was sending --sat_per_byte through rpc so that works as a workaround. It would be nice if regtest could be fixed like testnet though for the fee estimation.

@Roasbeef

This comment has been minimized.

Member

Roasbeef commented Oct 15, 2018

Closing this for now as it's an issue with regtest. We don't do fee estimation on simnet or regtest as the fees are non-sense. For this use-case, you need to manually set fees at time depending on how many blocks have been mined at that point.

@Roasbeef Roasbeef closed this Oct 15, 2018

@PWKad

This comment has been minimized.

Contributor

PWKad commented Oct 15, 2018

I feel like handling regtest similar to testnet and ignoring the fee warning or whatever would be the correct approach here.

Else you have to add in a bunch of code to handle fees so you can run on regtest that you no longer need on mainnet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment