Christian Decker
eb531e6da7
db: Make sure to enable foreign keys even after forking
This may be causing #1280 , since with `--daemon` the DB is being reopened
without enabling the foreign key relations and hence the delete cascades.
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
e41d565103
pytest: Add a test for the gossip perstistence
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
63f22d70b5
gossip: Store channel deletions so we don't re-add them on restart
If we only remember the actions that added channels then we'd restore them when
re-reading the gossip_store, so put a tombstone in there to remember to delete
it. These will be cleared upon re-writing the store since the announcements wont
be written anymore.
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
9132a097b5
gossip: Free the channel when notified of its funding being spent
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
428f5608fa
pytest: Testing for a node whose channels were closed will not work
In the next commit we remove channels whose outpoint was spent from our network
view, so checking for it will not work anymore.
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
633f893ec4
gossip: Add function to notify gossipd about an outpoint spend
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
a8d587c418
wallet: Return any eventual outpoint scid when marking it spent
Just return the short_channel_id matching the outpoint that we just marked as
spent.
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
5571f2143e
gossip: Added message to notify gossipd of outpoint spends
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
1b604d5dd6
pytest: Wait for the funding transaction to be in the mempool
This can lead to failures in the valgrind configuration.
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
ZmnSCPxj
c1a43a04af
payalgo: Be willing to overpay up to maxfeepercent, for privacy.
This obscures how far an intermediate hop is from the ultimate
payee, and also obscures slightly the exact payment value.
Fixes : #1089
7 years ago
ZmnSCPxj
bc5fc692d1
pay: Let `sendpay` modify the recorded `msatoshi` of payments.
7 years ago
ZmnSCPxj
1fe79df867
.gitignore: Ignore `gossip_store` file.
This, is generated, by `make check`.
Probably better to put it in some location elsewhere, though?
7 years ago
Rusty Russell
a85ead7058
invoice: allow numeric labels again.
Fixes : #1291
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
practicalswift
dc25e3a6df
Make compiler happy
7 years ago
Rusty Russell
b45477b081
Make cppcheck happy and code clearer.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
practicalswift
760e9f6993
Add cppcheck checking as part of check-source
7 years ago
Rusty Russell
a54872063f
check-cppcheck: autogen suppressions for all the list_for_each(_safe)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Christian Decker
0e0ad1aa4d
gossip: Check that we have a node before applying changes
This was a tricky one to find, it turns out that some nodes are sending
node_announcements even if they don't have a channel announced yet. If they are
a peer and the channel is currently verifying then we'll have a local channel in
the network view, hence accept the node_announcement, but when replaying, the
node_announcement will be replayed and we won't have a channel yet. This just
skips node_announcements, which is always safe.
Reported-by: @laszlohanyecz
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
practicalswift
e25297dd0a
Remove unused functions not covered by unit tests
7 years ago
Rusty Russell
06e8fbda95
onchain: print exactly what we were doing if we fail in grind_feerate.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
practicalswift
8df29d169c
The overflow check mul_overflows_s64(int64_t, int64_t) overflows and triggers UB :-) Remove it
The overflow check `mul_overflows_s64(int64_t, int64_t)` overflows.
Since this is an signed integer overflow this triggers UB, which
in turn means that we cannot trust the check.
Luckily mul_overflows_s64(int64_t, int64_t) is unused. Removing it.
7 years ago
Christian Decker
f2e81fde44
travis: Updated docker builder images to include cppcheck
It's a check dependency from PR #1262 .
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
f341b508e1
pytest: Add checks that funding change and to_us get confirmed
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
5519717144
onchaind: Pass the funding spend height through when adding a UTXO
This is necessary since we have onchaind tell us about the
their_unilateral/to_us output, after it is already in a block.
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
ba7341ec87
cleanup: Make blockheights unsigned
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
aba0b0e01b
opening: Add the change scriptpubkey to the txfilter
This is necessary to track confirmations of or change output.
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
27db2d4ce2
wallet: Also track confirmations of their_unilateral/to_us outpoints
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
286cfefc62
wallet: Remove pruned outpoints from utxoset outpoint_filter
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
practicalswift
6269a4c55d
Remove unused functions not covered by unit tests
7 years ago
ZmnSCPxj
b914062465
pay: Also record how much we actually ended up sending.
7 years ago
practicalswift
7e9750ffee
Reduce variable scopes
7 years ago
practicalswift
94ca824cf5
Use correct format strings for signed integers
7 years ago
ZmnSCPxj
74f3662a3b
lightningd/subd.h: Add missing wire/wire.h.
If not included, a source file containing only
`#include<lightningd/subd.h>` will file compilation.
7 years ago
ZmnSCPxj
0bb9bcc0f1
wallet: Track some channel usage statistics.
Fixes : #1049
7 years ago
Mark Beckwith
217d4f99eb
Added link to macOS in install index.
Also, technically, the name of the current version of the OS is macOS, so I
updated it.
7 years ago
conanoc
e7c8b95be3
Fix include order
7 years ago
conanoc
c4700a13a7
Add guard for BACKTRACE_SUPPORTED
7 years ago
conanoc
4c6d72a919
Update git configs for mac build
7 years ago
Rusty Russell
880c19eb4e
doc: document restrictions on invoice RPC.
In particular: label must be a string, and description cannot use any
the JSON unicode escapes, which should be unnecessary with UTF-8
anyway.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
dfce8b5efd
common/json: move declaration into correct header.
Reported-by: @ZmnSCPxj
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
7ae013202f
json: make json_add_string do partial escapes.
This is useful when we log a JSON-escaped string, so we don't double-escape.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
ed9093fcbd
json: allow strange characters through our JSON parser.
Fixes : #387
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
9f7d4312ff
bolt11: undo json encoding for description bytes.
We don't handle \u, since we assume everyone sane is using UTF-8. We'd
still have to reject '\u0000' and maybe other weird cases if we did.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
54431d2b08
lightningd: escape our own alias when we print it in logs.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
4139f06780
json_getnodes: escape the alias when we print it out.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
76e8a11380
wallet: use json_escaped for invoice label.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
d92579f627
common/json_escaped: new type which explicitly notes a string is already JSON.
Trivial to use as a string, but it still means you should be careful
around it.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
a077c3defb
lightningd: test for weird aliases.
Test has inverted conditions to make it "pass", we fix as we go.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
8c838ebd76
test_lightning: Write test for invoices with weird characters.
It's currently expected to fail.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
439dc0f991
gossipd/gossip_store.h: fix check-source for new source file header guards
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago