Rusty Russell
8975fc2ceb
libwally: use their secp context for all our daemons.
...
I didn't convert all tests: they can still use a standalone context.
It's just marginally more efficient to share the libwally one for all
our daemons which link against it anyway.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-04-03 14:03:28 +02:00
Rusty Russell
20bbd92564
utils: add subdaemon_shutdown() to consolidate subdaemon cleanup.
...
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-04-03 14:03:28 +02:00
ZmnSCPxj
26f7014813
payalgo: Add maximum delay.
...
Fixes : #1086
2018-04-03 04:29:48 +00:00
Christian Decker
1133820ad6
db: Add a cleanup migration to clear any dangling utxoset entries
...
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-04-02 21:07:13 +02:00
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>
2018-04-02 21:07:13 +02:00
Christian Decker
e41d565103
pytest: Add a test for the gossip perstistence
...
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-03-30 16:35:00 +02:00
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>
2018-03-30 16:35:00 +02:00
Christian Decker
9132a097b5
gossip: Free the channel when notified of its funding being spent
...
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-03-30 16:35:00 +02:00
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>
2018-03-30 16:35:00 +02:00
Christian Decker
633f893ec4
gossip: Add function to notify gossipd about an outpoint spend
...
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-03-30 16:35:00 +02:00
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>
2018-03-30 16:35:00 +02:00
Christian Decker
5571f2143e
gossip: Added message to notify gossipd of outpoint spends
...
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-03-30 16:35:00 +02:00
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>
2018-03-30 16:34:31 +02:00
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
2018-03-30 15:40:32 +02:00
ZmnSCPxj
bc5fc692d1
pay: Let sendpay
modify the recorded msatoshi
of payments.
2018-03-30 15:40:32 +02:00
ZmnSCPxj
1fe79df867
.gitignore: Ignore gossip_store
file.
...
This, is generated, by `make check`.
Probably better to put it in some location elsewhere, though?
2018-03-30 00:01:46 +02:00
Rusty Russell
a85ead7058
invoice: allow numeric labels again.
...
Fixes : #1291
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-03-30 00:01:10 +02:00
practicalswift
dc25e3a6df
Make compiler happy
2018-03-29 23:16:03 +02:00
Rusty Russell
b45477b081
Make cppcheck happy and code clearer.
...
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-03-29 23:16:03 +02:00
practicalswift
760e9f6993
Add cppcheck checking as part of check-source
2018-03-29 23:16:03 +02:00
Rusty Russell
a54872063f
check-cppcheck: autogen suppressions for all the list_for_each(_safe)
...
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-03-29 23:16:03 +02:00
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>
2018-03-29 23:15:33 +02:00
practicalswift
e25297dd0a
Remove unused functions not covered by unit tests
2018-03-28 11:22:05 +02:00
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>
2018-03-28 01:43:39 +00:00
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.
2018-03-27 23:18:48 +00:00
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>
2018-03-27 23:17:48 +00:00
Christian Decker
f341b508e1
pytest: Add checks that funding change and to_us get confirmed
...
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-03-27 23:17:17 +00:00
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>
2018-03-27 23:17:17 +00:00
Christian Decker
ba7341ec87
cleanup: Make blockheights unsigned
...
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-03-27 23:17:17 +00:00
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>
2018-03-27 23:17:17 +00:00
Christian Decker
27db2d4ce2
wallet: Also track confirmations of their_unilateral/to_us outpoints
...
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-03-27 23:17:17 +00:00
Christian Decker
286cfefc62
wallet: Remove pruned outpoints from utxoset outpoint_filter
...
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-03-27 17:14:58 +02:00
practicalswift
6269a4c55d
Remove unused functions not covered by unit tests
2018-03-26 23:35:56 +00:00
ZmnSCPxj
b914062465
pay: Also record how much we actually ended up sending.
2018-03-26 05:01:49 +00:00
practicalswift
7e9750ffee
Reduce variable scopes
2018-03-26 01:31:21 +00:00
practicalswift
94ca824cf5
Use correct format strings for signed integers
2018-03-26 01:20:22 +00:00
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.
2018-03-26 01:09:59 +00:00
ZmnSCPxj
0bb9bcc0f1
wallet: Track some channel usage statistics.
...
Fixes : #1049
2018-03-26 01:08:52 +00:00
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.
2018-03-26 01:05:11 +00:00
conanoc
e7c8b95be3
Fix include order
2018-03-26 00:30:39 +00:00
conanoc
c4700a13a7
Add guard for BACKTRACE_SUPPORTED
2018-03-26 00:30:39 +00:00
conanoc
4c6d72a919
Update git configs for mac build
2018-03-26 00:30:39 +00:00
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>
2018-03-26 00:20:53 +00:00
Rusty Russell
dfce8b5efd
common/json: move declaration into correct header.
...
Reported-by: @ZmnSCPxj
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-03-26 00:20:53 +00:00
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>
2018-03-26 00:20:53 +00:00
Rusty Russell
ed9093fcbd
json: allow strange characters through our JSON parser.
...
Fixes : #387
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-03-26 00:20:53 +00:00
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>
2018-03-26 00:20:53 +00:00
Rusty Russell
54431d2b08
lightningd: escape our own alias when we print it in logs.
...
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-03-26 00:20:53 +00:00
Rusty Russell
4139f06780
json_getnodes: escape the alias when we print it out.
...
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-03-26 00:20:53 +00:00
Rusty Russell
76e8a11380
wallet: use json_escaped for invoice label.
...
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-03-26 00:20:53 +00:00