We do not, in fact, require Python to build, so we should still work
after `make distclean`.
Fixes: #6536
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
We didn't want a rule to generate config.vars, since user should run configure manually
with their desired options. However, we do want to be able to *refresh* it, because
otherwise, if we need a new configuration var for our Makefile, it won't get refreshed:
```
$ make
CC: cc -DBINTOPKGLIBEXECDIR="../libexec/c-lightning" -Wall -Wundef -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wold-style-definition -Werror -Wshadow=local -std=gnu11 -g -fstack-protector-strong -I ccan -I external/libwally-core/include/ -I external/libwally-core/src/secp256k1/include/ -I external/jsmn/ -I external/libbacktrace/ -I external/gheap/ -I external/build-x86_64-linux-gnu/libbacktrace-build -I external/libsodium/src/libsodium/include -I external/libsodium/src/libsodium/include/sodium -I external/build-x86_64-linux-gnu/libsodium-build/src/libsodium/include -I . -I/usr/local/include -I/usr/include/postgresql -DCCAN_TAKE_DEBUG=1 -DCCAN_TAL_DEBUG=1 -DCCAN_JSON_OUT_DEBUG=1 -DSHACHAIN_BITS=48 -DJSMN_PARENT_LINKS -DCOMPAT_V052=1 -DCOMPAT_V060=1 -DCOMPAT_V061=1 -DCOMPAT_V062=1 -DCOMPAT_V070=1 -DCOMPAT_V072=1 -DCOMPAT_V073=1 -DCOMPAT_V080=1 -DCOMPAT_V081=1 -DCOMPAT_V082=1 -DCOMPAT_V090=1 -DCOMPAT_V0100=1 -DCOMPAT_V0121=1 -DBUILD_ELEMENTS=1 -c -o
PYTHONPATH=contrib/msggen contrib/msggen/msggen/__main__.py
LD: cc config.vars -Lexternal/build-x86_64-linux-gnu -lwallycore -lsecp256k1 -ljsmn -lbacktrace -lsodium -L/usr/local/include -lm -lsqlite3 -lz -L/usr/lib/x86_64-linux-gnu -lpq -o
/bin/sh: 1: contrib/msggen/msggen/__main__.py: Permission denied
make: *** [Makefile:371: cln-grpc/proto/node.proto] Error 126
make: *** Waiting for unfinished jobs....
```
Here, PYTHON is the new var (here, unset). If we were building a binary, we'd depend on config.h,
and the Makefile says how to refresh that. But the Makefile includes config.vars (causing an
implicit dependency) so we really should have a rule to make that.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
We can keep a single array of 'already considered' utxos, with the same
result as Tony's patch prior.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
If a node has an onchain balance with at least one uneconomical UTXO, the fundchannel RPC call will lock up the node and will eventually crash it with OOM issues if the economical UTXO(s) do not add up to the fundchannel amount. This is because the while loop never exits because it keeps pulling in the same uneconomical UTXOs forever.
Changelog-Fixed: wallet: fundchannel no longer loops forever if the wallet contains insufficient funds, but an uneconomical UTXO.
Tony Giorgio <tonygiorgio@protonmail.com> says:
Reproduce:
1. Add 1 600 sat UTXO to a fresh node
2. Verify the fundchannel command fails with a low fee rate:
```
./lightning-cli fundchannel 0366abc8eb4da61e31a8d2c4520d31cabdf58cc5250f855657397f3dd62493938a 100000 1000
{
"code": 301,
"message": "Could not afford 100000sat using all 1 available UTXOs: 99522sat short"
}
```
3. Now do the command again, but with a higher fee rate, making the 600 sat UTXO uneconomical:
```
./lightning-cli fundchannel 0366abc8eb4da61e31a8d2c4520d31cabdf58cc5250f855657397f3dd62493938a 100000 10000
```
4. Observe the RPC call and the logs. The RPC call will never return, and the logs will stop after this:
```
2023-04-16T10:58:45.839Z DEBUG plugin-spenderp: mfc 34: multiconnect done.
2023-04-16T10:58:45.839Z DEBUG plugin-spenderp: mfc 34: 'parsefeerate' done
2023-04-16T10:58:45.839Z DEBUG plugin-spenderp: mfc 34: fundpsbt.
```
5. Keep CLN running long enough and you'll eventually run OOM.
The former seemed to replace the wrong line with the copied checksum.
We now add read it from the first line and add it on top of our sums.
This expression also seems a fair bit easier to understand now.
Signed-off-by: Peter Neuroth <pet.v.ne@gmail.com>
Removing the Fedora fake as it seems to be not necessary. We later copy
the checksum from the release captains checksums anyway.
Also adding the sum check as it gives more details about which file did
not match if so.
Signed-off-by: Peter Neuroth <pet.v.ne@gmail.com>
This ensures that we have the release captains checksum file where we
expect it to be and gives a little hint where to get it if needed.
Signed-off-by: Peter Neuroth <pet.v.ne@gmail.com>
This seems to be a cut & paste bug (mine, AFAICT!) from the command code:
```
rune = rune_derive_start(cmd, master_rune,
tal_fmt(tmpctx, "%"PRIu64,
rune_counter ? *rune_counter : 0));
```
In that case, rune_counter was a pointer, which could be NULL.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>