version 0.7 clightning

Listfunds shows me:

963692 satoshi available to fund channels
6280512 satoshi owned in channels
14832105 satoshi total channel capacity

When I try to fund a channel with 400000 I get:

lightning-cli fundchannel 02b414e4e29a685b8699152be47a0420fa3c8ab59629d2da2d6c0a95c582636350 400000
{ "code" : 301, "message" : "Cannot afford transaction" }



Could it be that the outputs depicted in listfunds do not have yet enough confirmations? Maybe you got them after you closed a channel and c-lightning did not allow you to use them right away. Could you check again?

  • 1
    That's my expectation as well. c-lightning 0.7 will only consider outputs with at least 1 confirmation by default. To use unconfirmed outputs you can use the minconf=0 parameter, but be careful since that can lead to chaining of unconfirmed transactions if the first one never confirms. – cdecker Mar 5 '19 at 10:33

When you use the fundchannel command, a 2-of-2 multisig transaction is made on-chain.

From The BOLT #3: Bitcoin Transaction and Script Formats:

"The amounts for each output MUST be rounded down to whole satoshis. If this amount, minus the fees for the HTLC transaction, is less than the dust_limit_satoshis set by the owner of the commitment transaction, the output MUST NOT be produced (thus the funds add to fees)."

Probably your funding ammount is under the ammount of the dust_limit_satoshis + transaction fees.

  • No 400k Satoshi is far more than the dust limit. I checked the Api of fundchannel command. It expects Satoshi and not msatoshi in which case we would be below dust limit – Rene Pickhardt Mar 5 '19 at 8:16
  • Ah ok, good to know. Thx. – dvg Mar 6 '19 at 6:51
  • I just tried again, and it gone through. I have no idea, when and why it happens. – Ronald Wiplinger Mar 6 '19 at 11:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.