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

lnd can create transaction below min fee rate #1030

Closed
akcelerator opened this issue Apr 5, 2018 · 6 comments · Fixed by #1215
Closed

lnd can create transaction below min fee rate #1030

akcelerator opened this issue Apr 5, 2018 · 6 comments · Fixed by #1215
Assignees
Labels
beginner Issues suitable for new developers bitcoind Bitcoin Core backend bug Unintended code behaviour wallet The wallet (lnwallet) which LND uses

Comments

@akcelerator
Copy link

Background

Trying to open channel using all funds available.

Your environment

  • lnd version 0.4.1-beta
  • Linux 2.6.32-042stab127.2 Fix name typo in README #1 SMP
  • Bitcoin Core Daemon version v0.16.99.0-2fc9437
  • go version go1.10 linux/amd64

Steps to reproduce

Tried to send all funds, daemon tell me that not enough funds, so I calculate difference and use "proper" amount. Well, that not work.

rav3n@node1:~$ lncli walletbalance
{
    "total_balance": "998955",
    "confirmed_balance": "998955",
    "unconfirmed_balance": "0"
}
rav3n@node1:~$ lncli openchannel xxxx 998955
[lncli] rpc error: code = Unknown desc = not enough witness outputs to create funding transaction, need 0.00999176 BTC only have 0.00998955 BTC  available
rav3n@node1:~$ lncli openchannel  xxxx 998734
[lncli] rpc error: code = Unknown desc = -26: mempool min fee not met, 221 < 1081 (code 66)
rav3n@node1:~$ lncli openchannel  xxxx 998955
[lncli] rpc error: code = Unknown desc = not enough witness outputs to create funding transaction, need 0.00998955 BTC only have 0 BTC  available
rav3n@node1:~$ lncli walletbalance
{
    "total_balance": "0",
    "confirmed_balance": "0",
    "unconfirmed_balance": "0"
}

Expected behaviour

Open channel

Actual behaviour

Channel not open, funds gone?

@littleskunk
Copy link
Contributor

mempool min fee not met is an error message from bitcoin core. Add mintxfee= to bitcoin.conf and it will work.

@Rav3nPL
Copy link

Rav3nPL commented Apr 5, 2018

Added

mintxfee=0.00000001

and restarted daemons. Funds still "0"

@Rav3nPL
Copy link

Rav3nPL commented Apr 5, 2018

Looks like tx is send and confirmed:
https://blockchain.info/pl/tx/a3330a16c46aff47de008207e9971e899d49f2acf8e80d2e434f6d69a84c8462,
But LN daemon is not aware of it.
Balances at zero, no channel in listchannels

@Roasbeef
Copy link
Member

Roasbeef commented Apr 5, 2018

Is the channel in pendingchannels?

@Rav3nPL
Copy link

Rav3nPL commented Apr 6, 2018

No, it was not.
Today I see BTC is back in walletbalance

lncli walletbalance
{
    "total_balance": "997820",
    "confirmed_balance": "997820",
    "unconfirmed_balance": "0"
}

I`m happy, but it is still odd.
There should be function to safely open channel using all funds available, or manually set tx fee, to not get stuck with some dust.

@Roasbeef
Copy link
Member

Roasbeef commented Apr 7, 2018

You can set the fees manually for channel opening:

  --conf_target value    (optional) the number of blocks that the transaction *should* confirm in, will be used for fee estimation (default: 0)
   --sat_per_byte value   (optional) a manual fee expressed in sat/byte that should be used when crafting the transaction (default: 0)

@Roasbeef Roasbeef changed the title mempool min fee not met lnd can create transaction below min fee rate Apr 7, 2018
@Roasbeef Roasbeef added bug Unintended code behaviour wallet The wallet (lnwallet) which LND uses beginner Issues suitable for new developers bitcoind Bitcoin Core backend labels Apr 7, 2018
Roasbeef added a commit that referenced this issue Apr 19, 2018
In this commit we update to the latest version of btcwallet which will
properly detect bitcoind rejections when attempting to retransmit
unmnined transaction on restart. Additionally, we'll now remove any
transaction that are rejected from the mempool at broadcast time.

Related to #1030.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginner Issues suitable for new developers bitcoind Bitcoin Core backend bug Unintended code behaviour wallet The wallet (lnwallet) which LND uses
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants