lnd: sendcoins generated a transaction which did not show up in the network

What broke

lncli sendcoins generated a transaction, yet it did to show up in the blockchain explorer or the external wallet

Theory

A possible explanation is that lncli sendcoins seems to be able to generate transactions that will be rejected by the network

Environment

Testnet, Autopilot, 30 channels, running LND 83b779dcdf535be5004c4254b805f797aa5b1d0c (Feb 23)

Context (what happened?)

To do LND upgrade:

  1. I turned off Autopilot
  2. Closed all the channels (a few had to --force)
  3. After about 1 hour all channels were still closed, and it looked like all funds were in the wallet (yet, I failed to grab the output of lncli walletbalance at that time)

It’s usually difficult to see how much funds I have total among the wallet and the channels. Yet it looked like I had 2.3 tBTC available to transfer out. I tried moving out 2.3 tBTC as follows, and the command “succeed”:

$ lncli sendcoins --addr tb1q<...> 230000000  --sat_per_byte 40
{
    "txid": "b0a732349958b2a771562fd25f05492fa3e6bcaa4af082daadb1aaf89e0641ee"
}

A day later, transaction is still not visible in testnet, and in the balances looks like I only have 1.6 tBTC:

$ lncli channelbalance
{
    "balance": "0"
}

$ lncli walletbalance
{
    "total_balance": "1637104",
    "confirmed_balance": "1080833",
    "unconfirmed_balance": "556271"
}

Did this ever work?

When funds are available

Yes. I used lncli sendcoins many times to do LND upgrades. The transaction would show up in the external wallet almost instantly (5 seconds) and then would get confirmed easily with --sat_per_byte 40. Yet, this time the transaction did not even show up.

When funds are not available

Yes. Many times when I specify the amount that was too large, lncli sendcoins would always tell me that not enough funds are available, and not generate a transaction.

Proposal (what I’d expect to happen)

Since funds may not be truly available until all the Timelock contracts are fulfilled, I expect that lncli sendcoins would report that funds are not yet available and not generate a transaction.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

This PR to add a makefile can be extended to do so: https://github.com/lightningnetwork/lnd/pull/689

You’d do something like set a variable string in lnd.go, then pass the commit hash through with -ldflags.