Commit Graph

1391 Commits

Author SHA1 Message Date
Rusty Russell 22fe2c921f lightningd: commit short-channel-id to db when we create it.
We'd usually commit to the db soon, but there's a window where it
could be missed.

Also moves loc into the block it's used and make it tmpctx to avoid
an explicit free.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-04-23 20:18:15 +00:00
Rusty Russell 7604f27fb8 lightningd: make sure openingd and uncommitted_channel free each other.
Without this, we can get errors on shutdown:

Valgrind error file: valgrind-errors.27444
==27444== Invalid read of size 8
==27444==    at 0x1950E2: secp256k1_pubkey_load (secp256k1.c:127)
==27444==    by 0x19CF87: secp256k1_ec_pubkey_serialize (secp256k1.c:189)
==27444==    by 0x14FED9: towire_pubkey (towire.c:59)
==27444==    by 0x15AAFB: towire_gossipctl_peer_disconnected (gen_gossip_wire.c:969)
==27444==    by 0x1253EF: opening_channel_errmsg (opening_control.c:526)
==27444==    by 0x1386A3: destroy_subd (subd.c:589)
==27444==    by 0x18222C: notify (tal.c:240)
==27444==    by 0x1826E1: del_tree (tal.c:400)
==27444==    by 0x182733: del_tree (tal.c:410)
==27444==    by 0x182733: del_tree (tal.c:410)
==27444==    by 0x182B1F: tal_free (tal.c:511)
==27444==    by 0x11FC53: main (lightningd.c:410)
==27444==  Address 0x6c3af98 is 72 bytes inside a block of size 216 free'd
==27444==    at 0x4C30D3B: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27444==    by 0x1827BC: del_tree (tal.c:421)
==27444==    by 0x182B1F: tal_free (tal.c:511)
==27444==    by 0x11F3C7: shutdown_subdaemons (lightningd.c:211)
==27444==    by 0x11FC27: main (lightningd.c:406)
==27444==  Block was alloc'd at
==27444==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27444==    by 0x182296: allocate (tal.c:250)
==27444==    by 0x182863: tal_alloc_ (tal.c:448)
==27444==    by 0x12F2DF: new_peer (peer_control.c:74)
==27444==    by 0x125600: new_uncommitted_channel (opening_control.c:576)
==27444==    by 0x125870: peer_accept_channel (opening_control.c:668)
==27444==    by 0x13032A: peer_sent_nongossip (peer_control.c:427)
==27444==    by 0x116B9E: peer_nongossip (gossip_control.c:60)
==27444==    by 0x116F2B: gossip_msg (gossip_control.c:172)
==27444==    by 0x138323: sd_msg_read (subd.c:503)
==27444==    by 0x137C02: read_fds (subd.c:330)
==27444==    by 0x175550: next_plan (io.c:59)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-04-23 20:18:15 +00:00
Rusty Russell 05ba976a41 lightningd: --dev-no-reconnect needs to always suppress reconnection.
It didn't in the restore-from-db case.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-04-23 20:18:15 +00:00
ZmnSCPxj 2cee1ab20f peer_control: Make close wait for complete closure, with timeout.
Also report tx and txid, and whether we closed unilaterally or
bilaterally, if we could close the channel.

Also make a manpage.

Fixes: #1207
Fixes: #714
Fixes: #622
2018-04-23 05:24:46 +00:00
conanoc 7170521895 change spaces to tabs, align function parameters 2018-04-21 15:55:00 +02:00
conanoc 0733770559 Adjust indents 2018-04-21 15:55:00 +02:00
ZmnSCPxj 774af5f817 payalgo: Describe `maxdelay` argument of `pay`. 2018-04-17 17:29:36 +02:00
ZmnSCPxj, ZmnSCPxj jxPCSmnZ 11ca729d85 wallet, payalgo: Save detail of payment failures for later reporting. (#1345)
Pointless for remote failures as those are never sent by
the erring node, but for local failures we can give more
detail.
2018-04-16 15:29:40 +02:00
conanoc b2f7e9af4a Support debugging with lldb
Running with lldb cause SIGINT, which makes waitpid() returns
error with errno as EINTR. This patch retry waitpid() to ignore
EINTR errors.
2018-04-15 17:42:24 +02:00
Rusty Russell 7ca4422d7d closing_control: always prefer lower fee, not closest to ideal.
We had an intermittant test failure, where the fee we negotiated was
further from our ideal than the final commitment transaction.  It worked
fine if the other side sent the mutual close first, but not if we sent
our unilateral close first.

ERROR: test_closing_different_fees (__main__.LightningDTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/test_lightningd.py", line 1319, in test_closing_different_fees
    wait_for(lambda: p.rpc.listpeers(l1.info['id'])['peers'][0]['channels'][0]['status'][1] == 'ONCHAIN:Tracking mutual close transaction')
  File "tests/test_lightningd.py", line 74, in wait_for
    raise ValueError("Error waiting for {}", success)
ValueError: ('Error waiting for {}', <function LightningDTests.test_closing_different_fees.<locals>.<lambda> at 0x7f4b43e31a60>)

Really, if we're prepared to negotiate it, we should be prepared to
accept it ourselves.  Simply take the cheapest tx which is above our
minimum.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-04-15 15:32:14 +02:00
Christian Decker f27cd3e43f topo: Remove in-memory txs from the block struct
The only use for these was to compute their txids so we could notify depth
in case of reorgs.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-04-13 00:04:37 +02:00
Christian Decker 23984ecde4 chaintopology: Use the DB to locate transactions and rebroadcast txs
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-04-13 00:04:37 +02:00
Christian Decker 86b6402e5c chaintopology: Refactor get_tx_depth to use the DB backed tx store
We are slowly hollowing out the in-memory blockchain representation to make
restarts easier.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-04-13 00:04:37 +02:00
Christian Decker aa696370af txwatch: Switch to passing only txid into the depth callbacks
All of the callback functions were only using the tx to generate the txid again,
so we just pass that in directly and save passing the tx itself.

This is a simplification to move to the DB backed depth callbacks. It'd be
rather wasteful to read the rawtx and deserialize just to serialize right away
again to find the txid, when we already searched the DB for exactly that txid.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-04-13 00:04:37 +02:00
Christian Decker 50600ae241 wallet: Store transactions we are watching, broadcast or own
This will later allow us to determine the transaction confirmation count, and
recover transactions for rebroadcasts.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-04-13 00:04:37 +02:00
Rusty Russell b0c2e3cd5c gossipd: use a separate CSV file for the gossip_store types.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-04-11 15:58:18 +02:00
ZmnSCPxj 957513666c closing_control: Fix loop limit in better_closing_fee. 2018-04-10 20:45:16 +00:00
ZmnSCPxj 86290b54d4 routing: Use 64-bit msatoshi for messages to and from routing.
Internally both payment and routing use 64-bit, but the interface
between them used 32-bit.
Since both components already support 64-bit we should use that.
2018-04-09 20:45:26 +02:00
Christian Decker 0ba687732f bitcoind: Do not copy the newline character when asking for a block
In the short_channel_id check we were copying the entire result into the next
bitcoin-cli call, including the newline character.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
Reported-By: @gdassori
2018-04-09 00:21:20 +00:00
ZmnSCPxj 8a9fef2127 peer_control: Indicate how much money in the channel is spendable, given the reserve. 2018-04-08 08:23:34 +00:00
Christian Decker a41ab650e5 master: Move pid-file creation after the daemonization
Creating the pid-file before daemonizing results in the pid-file containing the
pid of the process that started the daemon, but is now dead.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
Reported-By: Torkel Rogstad @torkelrogstad
2018-04-07 19:49:40 +02:00
Rusty Russell 09c4203767 bolt11: allow multiple fallback addresses.
We can have more than one; eg we might offer both bech32 and a p2sh
address, and in future we might offer v1 segwit, etc.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-04-06 14:26:53 +02:00
Christian Decker 9ab28d1659 topology: Two off-by-one error when catching up with the blockchain
There are two very hard problems in software engineering:

 1. Off-by-one errors

In this case we were rolling back further than needed and we were starting the
catchup one block further than expected.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-04-06 06:55:41 +00:00
Rusty Russell daa14f48f2 peer_control: don't list opening channels as connected=false.
I saw a failure in test_funding_fail():
	assert l2.rpc.listpeers()['peers'][0]['connected']

This can happen if l2 hasn't yet handed back to gossipd.  Turns out
we didn't mark uncommitted channels as connected:

	[{'id': '03afa3c78bb39217feb8aac308852e6383d59409839c2b91955b2d992421f4a41e', 'connected': False, 'channels': [{'state': 'OPENINGD', 'owner': 'lightning_openingd', 'funder': 'REMOTE', 'status': ['Incoming channel: accepted, now waiting for them to create funding tx']}]}]

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-04-05 19:07:23 +02:00
Rusty Russell 21fbae6df8 openingd: ensure that initial channel can cover fees and reserve.
This is probably covered by our "channel capacity" heuristic which
requires the channel be significant, but best to be explicit and sure.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-04-05 19:07:23 +02:00
ZmnSCPxj f83c4ff903 wallet: Add msatoshi_to_us_min and msatoshi_to_us_max statistics for channels.
So we know how much counterparty could theoretically steal from us
 (msatoshi_to_us - msatoshi_to_us_min) and how much we could
 theoretically steal from counterparty (msatoshi_to_us_max -
 msatoshi_to_us).
For more piloting goodness.
2018-04-05 19:01:53 +02:00
ZmnSCPxj 5a267eb831 pay, payalgo: Show erring_node as compressed DER pubkey.
For consistency with other node pubkeys.
2018-04-04 14:17:07 +02:00
Rusty Russell 1764d6c907 grind_htlc_tx_fee: benchmark.
Takes 15 seconds on my laptop to do the worst-case grind:

	$ onchaind/test/run-grind_feerate 250001
	250001 iterations in 15893 msec = 63574 nsec each

It's not worth optimizing as it's 75% in libsecp:

    29.65%  run-grind_feera  run-grind_feerate  [.] secp256k1_fe_mul_inner
    23.51%  run-grind_feera  run-grind_feerate  [.] secp256k1_fe_sqr_inner
    11.04%  run-grind_feera  run-grind_feerate  [.] secp256k1_gej_double_var.part.6.constprop.34
     9.56%  run-grind_feera  run-grind_feerate  [.] secp256k1_scalar_reduce_512
     5.70%  run-grind_feera  run-grind_feerate  [.] Round

Even forcing a compile with -O3 -flto, it's only 13883 msec = 55534 nsec each.

Fixes: #291
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-04-04 02:31:41 +00:00
Rusty Russell 5f1c77d249 test_lightning.py: add test for onchain with different feerates.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-04-04 02:31:41 +00:00
Rusty Russell 6bb47276ce lightningd: put min/max feerates into db, struct channel.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-04-04 02:31:41 +00:00
Rusty Russell 4234321f7e onchain: get feerate min/max from master.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-04-04 02:31:41 +00:00
Rusty Russell 1f9ad06056 lightningd: allow us to close channel while still awaiting lockin.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-04-03 23:22:59 +02:00
Rusty Russell 1773b03380 channeld: accept SHUTDOWN before channel is locked.
Fixes: #1308
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-04-03 23:22:59 +02:00
Rusty Russell 1a4a59d221 common/daemon: common routines for all daemons.
In particular, the main daemon and subdaemons share the backtrace code,
with hooks for logging.

The daemon hook inserts the io_poll override, which means we no longer
need io_debug.[ch].  Though most daemons don't need it, they still link
against ccan/io, so it's harmess (suggested by @ZmnSCPxj).

This was tested manually to make sure we get backtraces still.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-04-03 14:03:28 +02:00
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
ZmnSCPxj 26f7014813 payalgo: Add maximum delay.
Fixes: #1086
2018-04-03 04:29:48 +00: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 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
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
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 e25297dd0a Remove unused functions not covered by unit tests 2018-03-28 11:22:05 +02: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
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
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
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
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>
2018-03-26 00:20:53 +00:00
Christian Decker 0a5ea76d77 gossip: Add message types to store gossip msgs and associate data
Since we may want to extend the on-disk format by adding custom information we
may as well just go the extra mile and reuse the serialization primitives we
already have.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-03-25 23:56:59 +00:00
practicalswift a4059ef83e Use expected LIGHTNING_DIR_FILE_H define 2018-03-25 23:54:21 +00:00
practicalswift 98f49c0837 Remove include in file foo.c that is already included in foo.h 2018-03-25 23:54:21 +00:00
Igor Cota 8c00e4f98d Add --bitcoin-rpcport option to pass to bitcoin-rpc 2018-03-25 23:17:36 +02:00
practicalswift 0bf1b01425 Fix typos 2018-03-25 15:53:01 +02:00
Mark Beckwith 489d8d04a6 Fund all (#1249)
* Funding channel with "all"
* Added test for fund all
2018-03-21 00:06:04 +01:00
ZmnSCPxj 5737853123 options: Add --autocleaninvoice-* options. 2018-03-20 17:25:51 +01:00
ZmnSCPxj 159e736fc1 invoices: Implement autocleaninvoice. 2018-03-20 17:25:51 +01:00
ZmnSCPxj 3b0081aebb invoices: Add delexpiredinvoice command. 2018-03-20 17:25:51 +01:00
Rusty Russell 8966a175ee chaintopology: add debug message when we're adjusting due to feerate floor.
But only if we're actually going to change the feerate, otherwise we'd
log every time.

Suggested-by: @ZmnSCPxj
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-03-20 16:08:45 +01:00
Rusty Russell 2e687b9b35 chaintopology: set a fee floor to avoid creating unrelayable txs.
Naively, this would be 250 satoshi per sipa, but it's not since bitcoind's
fee calculation was not rewritten to deal with weight, but instead bolted
on using vbytes.

The resulting calculations made me cry; I dried my tears on the thorns
of BUILD_ASSERT (I know that makes no sense, but bear with me here as I'm
trying not to swear at my bitcoind colleagues right now).

Fixes: #1194
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-03-20 16:08:45 +01:00
ZmnSCPxj, ZmnSCPxj jxPCSmnZ 044705a547 peer_control: Fix a use-after-free bug. (#1237)
This bug is a classic case of being lazy:
1. peer_accept_channel() allocated its return off the input message,
   rather than taking an explicit allocation context.  This concealed the
   lifetime nature of the return.
2. The context for sanitize_error was the error itself, rather than the
   more obvious tmpctx (connect_failed does not take).

The global tmpctx removes the "efficiency" excuse for grabbing a random
object to use as context, and is also nice and explicit.

All-the-hard-work-by: @ZmnSCPxj
2018-03-19 09:27:09 +00:00
practicalswift e56eee50c8 Make sure we never pass a negative value to dup2(...) 2018-03-19 09:25:39 +00:00
ZmnSCPxj 9efe123a0d lightningd/json: Move json helpers specific for lightningd to new module. 2018-03-19 00:27:55 +00:00
ZmnSCPxj 881eb80f6a payalgo: Make 'pay' return similar to 'listpayments' 2018-03-19 00:27:55 +00:00
ZmnSCPxj 3c39bcc0f7 pay: Make json_add_payment_fields accessible to other parts. 2018-03-19 00:27:55 +00:00
ZmnSCPxj d181ecbeea payalgo: Implement retry_for for pay command. 2018-03-19 00:27:55 +00:00
ZmnSCPxj 981af478f1 payalgo: Keep and report route and route failures. 2018-03-19 00:27:55 +00:00
ZmnSCPxj 234d67da34 channel_fail_permanent: Use a channel-level error, not an all-channels error.
Fixes: #1229
2018-03-17 13:26:58 +01:00
ZmnSCPxj d49915cdd2 peer_control: Have listpeers also return channel ID. 2018-03-17 13:26:58 +01:00
ZmnSCPxj 099acb2a66 opening_control: have fundchannel also return channel_id.
For voyeurism.
2018-03-17 13:26:58 +01:00
Rusty Russell 4ffd5e213b pay: work around bug #1212 for existing databases.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-03-16 04:01:06 +00:00
Rusty Russell 1b9791f0f5 pay: delete HTLC when we delete payment.
This fixes the root cause of https://github.com/ElementsProject/lightning/issues/1212
where we deleted the payment because we wanted to retry, then retry failed
so we had an (old) HTLC without a matching payment.  We then fed that
HTLC to onchaind, which tells us it's missing, and we try to fail the
payment and deref a NULL pointer.

Fixes: #1212
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-03-16 04:01:06 +00:00
ZmnSCPxj 7bbc1948f7 chaintopology: Add missing `block_map_del`.
We would `block_map_add` inside `add_tip`, but we never
`block_map_del` inside `remove_tip`, which is dangerous as
we actually `tal_free` the block inside `remove_tip`.

Our CI did not reliably trap this problem since block
hashes are random and rerunning the `test_blockchaintrack`
often passed spuriously.
2018-03-16 01:45:08 +00:00
ZmnSCPxj 022cfccddd pay: sendpay and waitsendpay print similar to listpayments 2018-03-16 01:24:43 +00:00
ZmnSCPxj fa281d32ea pay: sendpay_result has payment on success or in-progress. 2018-03-16 01:24:43 +00:00
practicalswift f9bd43f266 Limit scope of variable failcode. Remove dead code. 2018-03-16 01:17:40 +00:00
practicalswift b557e7b0fc Fix misleading indentation (space before tab) 2018-03-16 01:17:40 +00:00
practicalswift 7bd1ae6b2e Fix misleading indentation (in the case of DEVELOPER) 2018-03-16 01:17:40 +00:00
practicalswift b206aed371 Remove redundant cast to same type 2018-03-16 01:17:40 +00:00
practicalswift 03e2e404f2 Mark unused parameters as such (using "UNUSED") 2018-03-16 01:17:40 +00:00
Rusty Russell e63b7bb539 take: allocate temporary variables off NULL.
If we're going to simply take() a pointer, don't allocate it off a random
object.  Using NULL makes our intent clear, particularly with allocating
packets we're going to take() onto a queue.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-03-16 00:16:10 +00:00
Rusty Russell 0a6e3d1e13 utils: remove tal_tmpctx altogether, use global.
In particular, we now only free tmpctx at the end of main().

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-03-16 00:16:10 +00:00
Rusty Russell de5d84097e lightningd: remove ltmp context now we have tmpctx.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-03-16 00:16:10 +00:00
Rusty Russell ef2a063169 utils: add a global tmpctx.
I did a brief audit of tmpctx uses, and we do leak them in various
corner cases.  Fortunely, all our daemons are based on some kind of
I/O loop, so it's fairly easy to clean a global tmpctx at that point.

This makes things a bit neater, and slightly more efficient, but also
clearer: I avoided creating a tmpctx in a few places because I didn't
want to add another allocation.  With that penalty removed, I can use
it more freely and hopefully write clearer code.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-03-16 00:16:10 +00:00
Rusty Russell 41ef42ee94 memdump: fix overzealous assertions from b857b2e843
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-03-16 00:16:10 +00:00
ZmnSCPxj a0c2686ebd pay: Have sendpay wait for payment to be saved.
The payment should be stored in a "timely" manner, i.e.
within 10ms.
2018-03-14 05:33:09 +00:00
ZmnSCPxj a7a18b96cf pay: Rename some sendpay functions and fields to waitsendpay
Nearer to their actual purposes at this point.  Also in preparation
for next change.
2018-03-14 05:33:09 +00:00
ZmnSCPxj 61882ed9df pay: Add hook for triggering storage of payments. 2018-03-14 05:33:09 +00:00
ZmnSCPxj 24ee5d0437 pay: Store payment on failure. 2018-03-14 05:33:09 +00:00
ZmnSCPxj 411c9583a7 pay: Save and recover failure information.
Needed for particular race condition: client calls `sendpay` with
intent to call `waitsendpay` later to get information, but the
payment fails after `sendpay` returns but before client can invoke
`waitsendpay`.
This lets client know of information even if it manages to invoke
`waitsendpay` "late".
2018-03-14 05:33:09 +00:00
ZmnSCPxj 1e4adb0359 pay: Make sendpay nonblocking. 2018-03-14 05:33:09 +00:00
ZmnSCPxj bb4661f008 pay: Factor out construction of sendpay_result 2018-03-14 05:33:09 +00:00
Rusty Russell 46cc7c281e features: more general accessor functions.
As we add more features, the current code is insufficient.

1. Keep an array of single feature bits, for easy switching on and off.
2. Create feature_offered() which checks for both compulsory and optional
   variants.
3. Invert requires_unsupported_features() and unsupported_features()
   which tend to be double-negative, all_supported_features() and
   features_supported().
4. Move single feature definition from wire/peer_wire.h to common/features.h.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-03-14 02:19:37 +00:00
Christian Decker 74a444eb7a jsonrpc: Return the channel capacity for listchannels
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-03-12 22:34:51 +00:00
Christian Decker 5690783148 gossip: Pass output value to gossipd
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-03-12 22:34:51 +00:00
Christian Decker a8e553098a gossip: Pass output value to gossipd
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-03-12 22:34:51 +00:00
Christian Decker cb4ba9bf4f gossip: Use the utxoset to shortcircuit the txout lookup
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-03-12 22:34:51 +00:00
ZmnSCPxj 1de124277b peer_control: Print both `to_self_delay` in listpeers. 2018-03-12 14:54:29 +01:00
John Barboza b4f7ce61b4 Append to crash log instead of creating new one
Multiple crashes accumulate in case you have some kind
of auto-restart for daemons.
2018-03-11 14:30:34 +01:00
Isidoro Ghezzi f24a7b9356 help: listnodes and listchannels,have optional arg 2018-03-11 14:27:09 +01:00
practicalswift 161ed320f8 Improve onboarding experience by handling common failure scenarios for new users more gracefully
Improve usability in these scenarios:
* bitcoin-cli not available in PATH and/or bitcoind not running
* bitcoin-cli available in PATH but bitcoind is not running
2018-03-08 23:51:45 +00:00
Rusty Russell 6c1233de44 channel: reserve a bip32 index as soon as channel is opened.
This simplifies things, and means it's always in the database.  Our
previous approach to creating it on the fly had holes when it was
created for onchaind, causing us to use another every time we
restarted.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-03-07 18:55:51 +01:00
Rusty Russell e76f863329 txfilter: clean up prototypes.
Use const, add TAKES to declaration.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-03-07 18:55:51 +01:00
Rusty Russell c9e271df90 pay: wrap missing route_channels handling in COMPAT_V052.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-03-07 18:55:51 +01:00
Rusty Russell 9d9c1c3db6 wallet: wrap missing last_processed_block handling in COMPAT_V052.
Our testing also reveals a bug: we start lightningd and shut it down
before fully processing the blockchain, so we don't set
last_processed_block.  Fix that by setting it immediately once we have
a block: worst case it goes backwards a little.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-03-07 18:55:51 +01:00
Rusty Russell 5d5c1a5da5 lightningd: don't discard const in get_chainparams().
In general, it is true that accessors should take const and discard it,
but chainparams is *always* const.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-03-07 18:55:51 +01:00
John Barboza 30b290cb8f Explicit error message when disconnect fails
Whether the peer is not connected or not gossiping.
2018-03-07 16:14:01 +01:00
John Barboza 0a1351fd51 gossipd: command to disconnect from a gossiping peer
lightning-cli disconnect <peer id>
2018-03-07 16:14:01 +01:00
Corné Plooy b2ce619bcd Fix order of includes 2018-03-06 19:26:21 +01:00
Corné Plooy 71c39e96f3 Instead of passing the line number behind the '\0' of an artificial command-line argument, store it in a global variable.
While it is still a bit of a hack, this makes the code much easier to read.
2018-03-06 19:26:21 +01:00
Corné Plooy b857b2e843 Add assertions in various places to ensure tal_fmt doesn't receive NULL as argument for strings. 2018-03-06 19:26:21 +01:00
Christian Decker e44ea0b363 topology: Add new P2WSH outpoints to the wallet utxoset
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-03-06 18:59:27 +01:00
Christian Decker ae30942e3f chaintopo: Record outpoint spends for owned outputs
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-03-06 18:59:27 +01:00
Christian Decker 2680e6d9ff wallet: Move txfilter into wallet
Transaction filters are strongly related to the wallet, this move just
makes it a bit more explicit.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-03-06 18:59:27 +01:00
Christian Decker 5fd19483a9 txfilter: Add an outpoint filter
This can be used both for our own outputs as well as the utxos we are
tracking.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-03-06 18:59:27 +01:00
Christian Decker 227dc36146 utxo: Add blockheight and spendheight to outputs to track state
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-03-06 18:59:27 +01:00
Christian Decker 1aa21498c3 topology: Track blockchain changes in the DB
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-03-06 18:59:27 +01:00
ZmnSCPxj 8e8d7c2aba pay/sendpay: Use spec names for rhash and r. 2018-03-05 20:21:37 +00:00
John Barboza 31b9b6bc1c clear onchaind subd in channel on error
When the subdaemon closes unexpectedly, clear the reference and
update the channel billboard with the description
2018-03-04 16:29:44 +01:00
ZmnSCPxj 1f6008689d payalgo: Throttle pay command if failure is due to blockheight disagreement. 2018-03-03 18:19:53 +01:00
John Barboza b50912d8b1 Print node alias when listing peers 2018-03-02 02:25:30 +00:00
Rusty Russell c5d41a23d7 short_channel_id: just use structeq.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-03-01 23:33:56 +01:00
Rusty Russell 042d5d13f5 short_channel_id: don't use bitfields.
I leave all the now-unnecessary accessors in place to avoid churn, but
the use of bitfields has been more pain than help.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-03-01 23:33:56 +01:00
Igor Cota cb6820d445 Do preimage, hash and consequentially bolt11 generation before we store the invoice in db.
This way we store bolt11 to the table as well, in case a client needs it later
2018-03-01 03:55:48 +00:00
Christian Decker a90502d917 jsonrpc: Refuse to forget a channel with an open HTLC
... instead provide useful suggestions as to how to close it.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-03-01 03:50:50 +00:00
Christian Decker aef5780f36 htlc: Extracted htlc detection from the channel destructor
Let's have a simple function that allows us to check whether a channel
still has an HTLC open.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
2018-03-01 03:50:50 +00:00
Corné Plooy f32ebb7dca Indentation fix. 2018-02-28 21:21:25 +01:00
Corné Plooy 1e879de89e json-rpc: connection_complete_ok and json_command_malformed should never receive NULL arguments. Pass "null" instead, where needed. 2018-02-28 21:21:25 +01:00
Corné Plooy d86ad15b53 json-rpc: translate NULL into "null" instead of "(null)". 2018-02-28 21:21:25 +01:00
practicalswift dbb7ea1e41 Adjust log level for logging disconnected RPC users ("Command failed after jcon close")
This is a follow-up to #1121
2018-02-28 11:38:22 +01:00
ZmnSCPxj 978e5c67d8 invoices: Remove persistent in-memory invoice structures. 2018-02-28 11:17:08 +01:00
ZmnSCPxj f05c86618c invoices: Change iteration interface to be more abstract. 2018-02-28 11:17:08 +01:00
ZmnSCPxj 9b4c6699f9 invoices: Semantically separate invoice details from invoice.
In preparation for removing in-memory invoice structures.
Invoice details are requested rarely anyway.
2018-02-28 11:17:08 +01:00
practicalswift a20cf5463d Adjust log level for logging disconnected RPC users ("Abandoning command" + "Command returned result after jcon close")
The following command can be used to trigger these messages:

```
$ timeout 0.01 cli/lightning-cli connect [insert-syntactically-valid-peer-id-here] 123.123.123.123 # where 123.123.123.123 is unreachable
```
2018-02-28 01:53:52 +00:00
ZmnSCPxj 73cda2f2ae payalgo: Report route, and result of trying route. 2018-02-27 13:38:32 +01:00
ZmnSCPxj 21cfec816d payalgo: Report number of tries on failure. 2018-02-27 13:38:32 +01:00
ZmnSCPxj 6c9d81ef42 payalgo: Remove reporting PAY_TRY_ANOTHER_ROUTE and PAY_UNPARSEABLE_ONION.
These error codes will cause `pay` to retry, so `pay` will never
actually report those error codes.
Those error codes will only get reported at the `sendpay` level.
2018-02-27 13:38:32 +01:00
Rusty Russell b7ed5670d5 lightningd: close and reopen db across fork for daemonize
Fixes: #1092
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-27 00:09:34 +01:00
Rusty Russell cf3f19524e gossip: formalize passing of siphash_seed.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-26 06:35:02 +00:00
ZmnSCPxj f7f55edcdb wireaddr: Do hostname resolution in parse_wireaddr.
Fixes: #834
2018-02-26 03:13:55 +00:00
ZmnSCPxj bd07a91782 jsonrpc: Let Base58 '2..' address work on both regtest and testnet. 2018-02-26 03:09:15 +00:00
John Barboza b028a0a439 invoice: add fallback address to invoice command
* Modifies invoice command to have the following format
  invoice <msatoshi> <label> <desc> <?expiry> <?fallbackaddr>
* Adds support for Segwit bcrt1 addresses for withdraw
* Add test case for fallback address in invoice creation
* Create a common json_tok_address_scriptpubkey to be used
  by invoice and withdraw commands.
2018-02-26 03:09:15 +00:00
ZmnSCPxj d23650d2ed Explain fuzz initial values. 2018-02-26 02:36:27 +00:00
ZmnSCPxj 2db6ff9186 gossip_control: Change defult fuzz of getroute to 75%. 2018-02-26 02:36:27 +00:00
ZmnSCPxj 6767434ea9 routing: Use siphash24 for route randomization
Primary idea by @rustyrussell
2018-02-26 02:36:27 +00:00
ZmnSCPxj 61d0b50c54 payalgo: Randomize paths as long as we respect maxfeepercent. 2018-02-26 02:36:27 +00:00
ZmnSCPxj 9693843141 payalgo: Change sendpay_parent to try_parent.
Now try_parent is used as the parent for all allocations needed
  for a try.
2018-02-26 02:36:27 +00:00
ZmnSCPxj 216c52940d gossipd: Add fuzz and seed to getroute request. 2018-02-26 02:36:27 +00:00
ZmnSCPxj 2b782ee436 gossip_control: Add fuzz and seed parameters.
In preparation for improved route randomization.
2018-02-26 02:36:27 +00:00
ZmnSCPxj e34be575aa lightning/peer_control.h: Minor cleanup of nonexistent functions. 2018-02-25 20:41:50 +00:00
Rusty Russell 50171d3e1a lightningd: add --bitcoin-cli arg for testing.
And remove unused bitcoin_datadir and BITCOIN_CLI.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-24 10:37:28 +01:00
Rusty Russell f0a12c5c23 bitcoind: retry after one second if a call fails.
There are two recurring calls: the estimatefee call and the
getblockcount call.  Currently we simply discard them on error, the
timer isn't rearmed.

This should fix a number of cases where bitcoind has an intermittant
failure and lightningd simply stops collecting blocks.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-24 10:37:28 +01:00
Rusty Russell 0204c44243 bitcoind: allow processing callbacks to indicate that a failure is spurious.
In particular, process_getblockhash() exits with status 8 when the block
number is out of range, which is expected.  Any other exit status should
be treated as a spurious error.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-24 10:37:28 +01:00
Rusty Russell cccdb53bec channel_states: fold all the ONCHAIND states into one.
The billboard is now far more useful to tell what's going on, and this
gets us closer to a state == owner mapping.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-23 18:02:00 +01:00
Rusty Russell 8aa7a48138 listpeers: display billboard as 'status' array.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-23 18:02:00 +01:00
Rusty Russell cca0a5412e subd: clear transient billboard on start and shutdown.
Use NULL on the callback to mean "clear the slot", and call it.

We have do this in two places: the old daemon might die, or the new
daemon might start first.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-23 18:02:00 +01:00
Rusty Russell 26b004e5af subd: handle status_peer_billboard messages from subdaemons.
We use a callback which updates the appropriate slot.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-23 18:02:00 +01:00
Rusty Russell db4de95033 lightningd: single transient billboard for opening peers.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-23 18:02:00 +01:00
Rusty Russell 86a04c59d4 lightningd: maintain a status billboard for each channel.
Each state (effectively, each daemon) has two slots: a permanent slot
if something permanent happens (usually, a failure), and a transient
slot which summarizes what's happening right now.

Uncommitted channels only have a transient slot, by their very nature.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-23 18:02:00 +01:00
Christian Decker 6f6176a91e options: Add `--offline` to disable listening and auto-reconnection 2018-02-23 06:30:15 +00:00
Rusty Russell 85f1a9b825 lightningd: append (as much as we can) version into default name if DEVELOPER=1
This helps for bug reporting, where we may need to diagnose the other
end.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-22 12:24:26 +01:00
practicalswift 1b51b5ae0f Remove unused parameter topo in txw_fire(struct chain_topology *topo, ...) 2018-02-22 10:46:30 +01:00
practicalswift 0046ace318 Remove unused parameter topo in txowatch_fire(struct chain_topology *topo, ...) 2018-02-22 10:46:30 +01:00
practicalswift 74841ef567 Remove unused parameter payment_hash in forward_htlc(..., const struct sha256 *payment_hash, ...) 2018-02-22 10:46:30 +01:00
practicalswift d873bf60bf Remove unused parameter fieldname in json_add_log(..., const char *fieldname, ...) 2018-02-22 10:46:30 +01:00
practicalswift 2ab274595e Remove unused parameter ptr in corrupt(const void *ptr, ...) 2018-02-22 10:46:30 +01:00
practicalswift f24eae60b7 Remove unused parameter why in delete_channel(..., const char *why) 2018-02-22 10:46:30 +01:00
practicalswift f15868a94d Remove unused function json_dev_broadcast(...) 2018-02-22 09:45:22 +00:00
Rusty Russell b536e97df2 dev_ping: don't crash with silly values.
It's a dev command, but still.

Fixes: #985
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-22 01:10:09 +00:00
practicalswift 91a9c2923f Mark intentionally unused parameters as such (with "UNUSED") 2018-02-22 01:09:12 +00:00
practicalswift 3dbace3421 Remove redundant casts to same type 2018-02-21 13:07:40 +01:00
Rusty Russell 369d3ab46e fixup! Close memory leak, make error exposure DEVELOPER=1 only. 2018-02-21 12:59:26 +01:00
Rusty Russell 9842e32e06 lightningd: expose internal error information.
In #1018 we got no information, except "Internal error".  At least
if we tell the other side what went wrong, we're more likely to get
an answer.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-21 12:59:26 +01:00
Rusty Russell 1192f16733 lightningd: fix crash when htlc failed and source is onchain.
If the source channel is onchain, we try to send a message to onchaind
which (1) doesn't care, (2) doesn't take a channel_fail_htlc msg, and
(3) causes us to crash in subd.c:

	assert(!strstarts(sd->msgname(fromwire_peektype(msg_out)), "INVALID"));

Fixes: #821
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-20 22:58:48 +01:00
Rusty Russell e92b710406 tools/generate-wire.py: remove length argument from fromwire_ routines.
We always hand in "NULL" (which means use tal_len on the msg), except
for two places which do that manually for no good reason.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-20 22:36:21 +01:00
Rusty Russell 719290a4c4 txwatch: remove unused callback arg, hide struct definitions.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-20 22:36:21 +01:00
Rusty Russell ae8fb96d06 lightningd/channel_control: routines to control channeld (move from peer_control.c)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-20 22:36:21 +01:00
Rusty Russell 36652a3df3 lightningd/peer_control: reorder, move more functions out.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-20 22:36:21 +01:00
Rusty Russell 372040bbd5 lightningd/onchain_control: routines to control onchaind (move from peer_control.c)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-20 22:36:21 +01:00
Rusty Russell 9176ee628c lightningd/closing_control: routines to control closingd (move from peer_control.c)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-20 22:36:21 +01:00
Rusty Russell a83ff83328 lightningd/connect_control: routines to control connecting (move from peer_control.c)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-20 22:36:21 +01:00
Rusty Russell 4cf274b1c0 lightningd/opening_control: routines to control openingd (move from peer_control.c)
We also fold opening_got_hsm_funding_sig() into the caller; it was
previously a callback before we decided to always use the HSM
synchronously.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-20 22:36:21 +01:00
Rusty Russell eca55cee3c subd: handle stdin being closed (eg. --daemon).
We need to do a more complex dance if stdin was important.

Fixes: #1016
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-20 21:42:53 +01:00
practicalswift 6bacab5e87 Fix typos 2018-02-20 13:05:51 +01:00
Rusty Russell 4aeebe88f2 log: fix ltmp crash.
When we clear and recreate ltmp, we attach it to whatever logbook it's on.
This, of course, is fraught, since it may be freed.

We could make it NULL-parented, but that makes YA special-case to free
when we exit (we try to keep valgrind happy by freeing everything).  So
since the first log_book is the permanent one attached to lightningd,
just keep that parent when we re-build it after use.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-20 12:58:13 +01:00
libbitc c360cb7b1f Add option to specify pid file
Closes #969
2018-02-20 03:24:23 +00:00
Rusty Russell 1dc6f7575a lightningd: fix crash when we get onchain after old db.
lightningd(25923): lightning_onchaind(03cbf298b068300be33f06c947b9d3f00a0f0e8089da3233f5db37e81d3a596fe1): UPDATE WIRE_ONCHAIN_MISSING_HTLC_OUTPUT
lightningd(25923): FATAL SIGNAL 11 RECEIVED
lightningd(25923): backtrace: lightningd/log.c:498 (log_crash) 0x410ae8
lightningd(25923): backtrace: (null):0 ((null)) 0x7ff2ddb8e0df
lightningd(25923): backtrace: lightningd/pay.c:231 (local_routing_failure) 0x415b33
lightningd(25923): backtrace: lightningd/pay.c:383 (payment_failed) 0x41604c
lightningd(25923): backtrace: lightningd/peer_htlcs.c:783 (onchain_failed_our_htlc) 0x4225e5
lightningd(25923): backtrace: lightningd/peer_control.c:1209 (handle_missing_htlc_output) 0x41b31c
lightningd(25923): backtrace: lightningd/peer_control.c:1323 (onchain_msg) 0x41b759
lightningd(25923): backtrace: lightningd/subd.c:498 (sd_msg_read) 0x425b40

Fixes: #878
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-20 01:38:32 +00:00
practicalswift f351417905 Add assertions to clarify our assumptions about msg != NULL 2018-02-19 12:17:55 +01:00