"Cannot afford transaction"

0

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" }

Why?

Ronald Wiplinger

Posted 2019-03-05T04:04:58.527

Reputation: 171

Answers

0

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.

dvg

Posted 2019-03-05T04:04:58.527

Reputation: 95

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 limitRene Pickhardt 2019-03-05T08:16:31.117

Ah ok, good to know. Thx.dvg 2019-03-06T06:51:00.790

I just tried again, and it gone through. I have no idea, when and why it happens.Ronald Wiplinger 2019-03-06T11:37:54.610

0

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?

Rene Pickhardt

Posted 2019-03-05T04:04:58.527

Reputation: 6 565

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 2019-03-05T10:33:12.347