Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] grs use wally sha256 and warp to v.0.7.1 #16

Merged
merged 640 commits into from Jul 18, 2019
Merged

[WIP] grs use wally sha256 and warp to v.0.7.1 #16

merged 640 commits into from Jul 18, 2019
This pull request is big! We’re only showing the most recent 250 commits.

Commits on May 26, 2019

  1. lightningd: suppress IO_OUT logging for getlog command

    Before this, the response of `getlog io` blew up quickly
    when called multiple times.
    SimonVrouwe authored and rustyrussell committed May 26, 2019
    Configuration menu
    Copy the full SHA
    db57d9c View commit details
    Browse the repository at this point in the history

Commits on May 27, 2019

  1. chaintopology: add REORG to logline when tx watch is fired after reorg

    This makes clear that txwatch_fire was called with depth=0 when
    chain tip got removed after a reorg. And now we can test for that.
    SimonVrouwe authored and cdecker committed May 27, 2019
    Configuration menu
    Copy the full SHA
    b261c5b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    eb3495c View commit details
    Browse the repository at this point in the history
  3. pytest: tighten a log test Owning output... with address type and c…

    …onfirmation
    
    Because the call (wallet_extract_owned outputs) that prints that line can happen
    _before_ or _after_ confirmation in block, adding `CONFIRMED` in the later.
    SimonVrouwe authored and cdecker committed May 27, 2019
    Configuration menu
    Copy the full SHA
    245807a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    24f43e5 View commit details
    Browse the repository at this point in the history
  5. pytest: added BitcoinD.simple_reorg() method, which can change tx hei…

    …ght and/or txindex
    
    Now without bitcoind restart.
    bitcoin-cli `prioritisetransaction` came to the rescue!
    Its argument `fee_delta` (apparently) lowers the txs _effective_ feerate
    soo low that bitcoind wont mine it ... untill we raise it when we want
    it to be mined.
    SimonVrouwe authored and cdecker committed May 27, 2019
    Configuration menu
    Copy the full SHA
    7726681 View commit details
    Browse the repository at this point in the history
  6. lightningd: funding_lockin_cb, handle reorgs that change short_channe…

    …l_id
    
    Keep watching and updating scid until ANNOUNCE_MIN_DEPTH, even when channel is private.
    When scid changes, we fail channeld so it will restart and initialize with updated
    scid and add it to rtable. Reorgs can change funding tx's height/index after lockin,
    which could happen with small minimum_depth=1.
    SimonVrouwe authored and cdecker committed May 27, 2019
    Configuration menu
    Copy the full SHA
    8c1bbf3 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    54a67c2 View commit details
    Browse the repository at this point in the history
  8. pytest: add test_funding_reorg_private, reorg changes funding height

    Reorg changes short_channel_id after lockin of private channel, while
    one node restarts.
    
    test that:
    - peer->depth_togo in billboard decrements
    - reorg and scid change is detected by running node and restarting node
    - both `old` and `new` scids are in rtable
    
    Also added a comment to test_blockchaintrack to clarify.
    SimonVrouwe authored and cdecker committed May 27, 2019
    Configuration menu
    Copy the full SHA
    5b0c174 View commit details
    Browse the repository at this point in the history
  9. pytest: add test_funding_reorg_remote_lags

    Nodes may disagree about short_channel_id before channel
    announcement.
    SimonVrouwe authored and cdecker committed May 27, 2019
    Configuration menu
    Copy the full SHA
    52c84b2 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    22600fa View commit details
    Browse the repository at this point in the history

Commits on May 29, 2019

  1. DB: Store the remote channel announcement signatures into DB

    1. Add the fields of remote channel announcement signatures into TABLE channels
    2. Add the related function
    trueptolemy authored and cdecker committed May 29, 2019
    Configuration menu
    Copy the full SHA
    b41d529 View commit details
    Browse the repository at this point in the history
  2. run-wallet: Add the check of case that channel received ann_sigs

    trueptolemy authored and cdecker committed May 29, 2019
    Configuration menu
    Copy the full SHA
    a645fbd View commit details
    Browse the repository at this point in the history
  3. Channeld: Add new wire type:channel_got_announcement

    Channeld sends announcement signatures to Master by this message.
    When Channeld receive a new channel announcement msg, (After channel locking)it will sends announcement signatures to Master by this message.
    trueptolemy authored and cdecker committed May 29, 2019
    Configuration menu
    Copy the full SHA
    d93f614 View commit details
    Browse the repository at this point in the history
  4. Channeld: init channel with remote announcement info when restart

    1. Add remote_ann_node_sigs and remote_bitcoin_sigs fields in channel_init message;
    2. Master add announcement signatures into channel_init message, and send this message to Channeld.
    Channeld will initial the channel with this signatures when it reenables the channel.
    trueptolemy authored and cdecker committed May 29, 2019
    Configuration menu
    Copy the full SHA
    1141243 View commit details
    Browse the repository at this point in the history

Commits on May 31, 2019

  1. lightningd/subd.c: Return NULL from subd_shutdown.

    And set pointers to shut down daemons as NULL in lightningd.
    ZmnSCPxj authored and cdecker committed May 31, 2019
    Configuration menu
    Copy the full SHA
    37440e9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3466261 View commit details
    Browse the repository at this point in the history
  3. pytest: Add a test that reproduces ElementsProject#2687

    Signed-off-by: Christian Decker <decker.christian@gmail.com>
    cdecker committed May 31, 2019
    Configuration menu
    Copy the full SHA
    883d4b4 View commit details
    Browse the repository at this point in the history
  4. lightningd/io_loop_with_timers.c: Move mainloop to its own source fil…

    …e, have chaintopology use it.
    
    Fixes: ElementsProject#2687
    ZmnSCPxj authored and cdecker committed May 31, 2019
    Configuration menu
    Copy the full SHA
    48df6c8 View commit details
    Browse the repository at this point in the history
  5. plugins: do I/O logging.

    I was trying to trace a problem with a plugin, and needed this.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and cdecker committed May 31, 2019
    Configuration menu
    Copy the full SHA
    8f9c482 View commit details
    Browse the repository at this point in the history
  6. plugin: fix printing of bad plugin responses.

    Before:
    	Plugin for invoice_payment returned non-result response 
    
    	"subscriptions": [], "hooks": ["invoice_payment"]}}
    
    	�V
    
    After:
    	Plugin for invoice_payment returned non-result response {"jsonrpc": "2.0", "id": 6, "error": "Error while processing invoice_payment: ValueError(\"invalid literal for int() with base 10: '5.0'\")"}
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and cdecker committed May 31, 2019
    Configuration menu
    Copy the full SHA
    695bec5 View commit details
    Browse the repository at this point in the history
  7. devtools/decode-iolog: tool to decode hexstrings from io logging.

    Slow, but useful.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and cdecker committed May 31, 2019
    Configuration menu
    Copy the full SHA
    0c189fe View commit details
    Browse the repository at this point in the history

Commits on Jun 3, 2019

  1. jsonrpc: Add a category field to commands.

    A new string field is added to the command structure and is specified at the creation of each native command, and in the JSON created by 'json_add_help_command()'.
    darosior authored and rustyrussell committed Jun 3, 2019
    Configuration menu
    Copy the full SHA
    323adb4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5b0bf0b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9d34121 View commit details
    Browse the repository at this point in the history
  4. cli: Sort human_readable output by categories

    A new field is available in the command json object : 'category' (corresponding to whether "bitcoin", "channel", "network", "payment", "plugin", "utility", "developer"). We use it to printf commands ordered by categories.
    
    credits @rustyrussel
    darosior authored and rustyrussell committed Jun 3, 2019
    Configuration menu
    Copy the full SHA
    b1bbafb View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    78326a8 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    fba050e View commit details
    Browse the repository at this point in the history
  7. Plugins: accept options of different types

    A new struct containing the plugin options value as different types is created and appended to the plugin_option structure
    darosior authored and rustyrussell committed Jun 3, 2019
    Configuration menu
    Copy the full SHA
    a6753fd View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    3775a32 View commit details
    Browse the repository at this point in the history
  9. Plugins: allow to specify plugin option type in libplugin.c, then spe…

    …cify it to autoclean options
    darosior authored and rustyrussell committed Jun 3, 2019
    Configuration menu
    Copy the full SHA
    4640d18 View commit details
    Browse the repository at this point in the history
  10. gossipd: fix uninitialized free on short_route in goto path

    Fix a path where tal_free is called on an uninitialized variable
    
    If the first `goto bad_total` executes, then that path has
    uninitialized `short_route` but bad_total passes through to `out`
    whose first call is tal_free(short_route).
    
    This was noticed by a maybe-uninitialized heuristic on gcc 7.4.0:
    
    gossipd/routing.c: In function ‘find_shorter_route’:
    gossipd/routing.c:1096:2: error: ‘short_route’ may be used
    uninitialized in this function [-Werror=maybe-uninitialized]
      tal_free(short_route);
    
    Reported-by: @ZmnSCPxj <ElementsProject#2674 (comment)>
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 authored and rustyrussell committed Jun 3, 2019
    Configuration menu
    Copy the full SHA
    3f035cb View commit details
    Browse the repository at this point in the history
  11. gossipstore: fix uninitialized input fd

    Initialize infd to STDIN_FILENO if the input file argument is missing.
    
    Caught with gcc version: 7.4.0
    
    devtools/create-gossipstore.c: In function ‘main’:
    devtools/create-gossipstore.c:130:9: error: ‘infd’ may be used
    uninitialized in this function [-Werror=maybe-uninitialized]
      while (read_all(infd, &be_inlen, sizeof(be_inlen))) {
    
    Suggested-by: @ZmnSCPxj <ElementsProject#2674 (comment)>
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 authored and rustyrussell committed Jun 3, 2019
    Configuration menu
    Copy the full SHA
    6f635b4 View commit details
    Browse the repository at this point in the history
  12. lightningd: fix uninitialized variable in DEVELOPER path

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 3, 2019
    Configuration menu
    Copy the full SHA
    fae593c View commit details
    Browse the repository at this point in the history
  13. gossipd: fix spurious gcc warning.

    It turns out that we don't look at type when we return 0, but gcc isn't
    quite smart enough for that.  Initializing to -1 is good practice anyway
    for the failure path.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 3, 2019
    Configuration menu
    Copy the full SHA
    c091a4e View commit details
    Browse the repository at this point in the history
  14. connectd: handle IPv6 correctly.

    Untested, but the current code is clearly wrong (caught by gcc-4.8 -O3).
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 3, 2019
    Configuration menu
    Copy the full SHA
    9820d06 View commit details
    Browse the repository at this point in the history
  15. gossipd: fix spurious unused error with gcc-9 -O3.

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 3, 2019
    Configuration menu
    Copy the full SHA
    c233fc5 View commit details
    Browse the repository at this point in the history
  16. wire/test: remove unused padding code.

    Turns out the peer part of the spec no longer uses padding (it's used only
    in the onion), and GCC-9 with -O3 warns we're padding NULL to memcpy.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 3, 2019
    Configuration menu
    Copy the full SHA
    5b7776c View commit details
    Browse the repository at this point in the history
  17. configure: handle --reconfigure better.

    `./configure CC=newcc --reconfigure` didn't set CC, because reconfigure
    simply replaced all values: only make it replace undefined values.
    
    Also, it didn't change COPTFLAGS or CWARNFLAGS, even if they were previously
    the defaults (eg. --reconfigure --enable-developer).
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 3, 2019
    Configuration menu
    Copy the full SHA
    ed08ca6 View commit details
    Browse the repository at this point in the history
  18. configure: detect modern gcc, and only suppress necessary errors.

    Drive-by fix of CONFIGURATOR_CC setting when CC is overridden on cmdline
    (not via env var).
    
    Note that clang defines __GNUC__ (to 4) :(
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 3, 2019
    Configuration menu
    Copy the full SHA
    7092d21 View commit details
    Browse the repository at this point in the history
  19. travis: add compilation to SOURCE_CHECK_ONLY.

    Our "-O3" CI check wasn't doing what I thought.  But building with -flto
    is hard with older gccs, so remove that.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 3, 2019
    Configuration menu
    Copy the full SHA
    7961a81 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    107381a View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    45645e3 View commit details
    Browse the repository at this point in the history
  22. pytest: catch more gossip-related errors.

    Basically, any "Bad" message from gossipd is something we should look
    at.  This covers failures loading the gossip_store, too!
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and niftynei committed Jun 3, 2019
    Configuration menu
    Copy the full SHA
    a40fe40 View commit details
    Browse the repository at this point in the history
  23. pytest: make test_gossip_notices_close more reliable.

    It's possible that it hasn't got the node_announcement messages;
    it will still list the nodes, however (the channel_announcement tells
    it the nodes exist).  Check for the alias field instead.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and niftynei committed Jun 3, 2019
    Configuration menu
    Copy the full SHA
    1147e65 View commit details
    Browse the repository at this point in the history
  24. pytest: more comprehensive tests for test_gossip_store_compact.

    First, we should have a channel_update so we actually do some compaction!
    (Reported-by @SimonVrouwe).  But we should also handle the cases where:
    
    1. A channel_announcement is *not* directly followed by a
       channel_update (happens when the channel_update is replaced).
    2. A node_announcement predates a channel_update for the peer
       (again, can happen once a channel_update is replaced).
    3. A local/private channel_creation is not directly followed by an
       update.
    
    In addition, we might as well check that we can *load* such a store,
    before compaction.
    
    This checks the corner cases which occur in real gossip stores.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and niftynei committed Jun 3, 2019
    Configuration menu
    Copy the full SHA
    048a650 View commit details
    Browse the repository at this point in the history
  25. gossip_store: fix 'bad node_announcement' by allowing node_announceme…

    …nt on un-updated channel.
    
    When we first receive a channel_update, we write both the
    channel_announcement and that channel_update to the store: we need
    that first update so we can set the channel_announcement timestamp.
    
    However, the channel_update can be replaced later.  This means we can
    have a channel_announcement, a node_update which relies on it, then
    the channel_update later.
    
    So move the "this applies to a pending announcement" check lower, where
    gossip_store can use it too.  Has a nice side-effect of avoiding
    one lookup of the node id.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and niftynei committed Jun 3, 2019
    Configuration menu
    Copy the full SHA
    21fe518 View commit details
    Browse the repository at this point in the history
  26. gossipd: fix gossip_store calling delete.

    Now we handle node_announcements properly, we have a failure case where we
    try to move them when a channel is deleted while loading the store.
    
    We're going to remove this soon, in favor of in-place delete, so
    workaround this for now to avoid an assert() when we try to write to
    the store while loading.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and niftynei committed Jun 3, 2019
    Configuration menu
    Copy the full SHA
    763697e View commit details
    Browse the repository at this point in the history

Commits on Jun 4, 2019

  1. json: Add some more methods to add integers of various size to json

    Signed-off-by: Christian Decker <decker.christian@gmail.com>
    cdecker authored and rustyrussell committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    80b3d8a View commit details
    Browse the repository at this point in the history
  2. pytest: Mark test_option_upfront_shutdown_script as flaky

    Signed-off-by: Christian Decker <@cdecker>
    cdecker authored and rustyrussell committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    9a4cf7d View commit details
    Browse the repository at this point in the history
  3. plugin: Add the htlc_accepted hook

    This is a rather simple hook that allows a plugin to take control over
    HTLCs that were accepted, but weren't resolved as part of an invoice
    or forwarded to the next hop yet.
    
    The goal is to allow plugins to terminate a route early, perform
    intermediate checks before the payment is accepted (check inventory or
    service delivery before accepting in order to avoid a refund for
    example) or handle an onion differently if it has a different
    realm (cross-chain atomic swaps).
    
    This doesn't implement serializing the payload or deserializing it,
    instead just passes the full context along. The details for
    serializing and deserializing will be implemented in a future commit.
    
    Signed-off-by: Christian Decker <decker.christian@gmail.com>
    cdecker authored and rustyrussell committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    7499f7d View commit details
    Browse the repository at this point in the history
  4. pytest: Add a simple test for the hooks

    This uses the `htlc_accepted` hook to delay payment acceptance.
    
    Signed-off-by: Christian Decker <decker.christian@gmail.com>
    cdecker authored and rustyrussell committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    b545770 View commit details
    Browse the repository at this point in the history
  5. plugin: Populate the request for the htlc_accepted hook

    Signed-off-by: Christian Decker <decker.christian@gmail.com>
    cdecker authored and rustyrussell committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    bf53821 View commit details
    Browse the repository at this point in the history
  6. plugin: Parse response for htlc_accepted hook

    Signed-off-by: Christian Decker <decker.christian@gmail.com>
    cdecker authored and rustyrussell committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    2b81e02 View commit details
    Browse the repository at this point in the history
  7. pytest: Add tests for htlc_accepted_hook

    Two tests: one for failures and one for in-path resolution.
    
    Signed-off-by: Christian Decker <decker.christian@gmail.com>
    cdecker authored and rustyrussell committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    9fd8be6 View commit details
    Browse the repository at this point in the history
  8. hooks: Add cltv_expiry_delta to the htlc_accepted hook

    Signed-off-by: Christian Decker <decker.christian@gmail.com>
    Suggested-by: Corné Plooy <@bitonic-cjp>
    cdecker authored and rustyrussell committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    1561ffa View commit details
    Browse the repository at this point in the history
  9. hooks: Add the raw payload to the htlc_accepted call

    Since we might soon be changing the payload it is a good idea to not just
    expose the v0 payload, but also the raw payload for the plugin to
    interpret. This might also include payloads that `lightningd` itself cannot
    understand, but the plugin might.
    
    Signed-off-by: Christian Decker <decker.christian@gmail.com>
    Suggested-by: Corné Plooy <@bitonic-cjp>
    cdecker authored and rustyrussell committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    adb984d View commit details
    Browse the repository at this point in the history
  10. startup: Reorder HTLC wiring on startup after the topology init

    Since the hook needs to pass information about the current blockheight to the
    plugin we need to first initialize the topology.
    cdecker authored and rustyrussell committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    f7bfe16 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    909913c View commit details
    Browse the repository at this point in the history
  12. startup: Tell peer_accepted_htlc whether we are replaying

    It disables the error when attempting to do a state transition from
    `RCVD_ADD_ACK_REVOCATION` to `RCVD_ADD_ACK_REVOCATION` which was done before
    getting to this point.
    
    Signed-off-by: Christian Decker <decker.christian@gmail.com>
    cdecker authored and rustyrussell committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    6db1e76 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    dd26a01 View commit details
    Browse the repository at this point in the history
  14. plugin: Cleanup the htlc_accepted_hook_deserialize interface

    Since we have more or less given up on the separation between response
    callback and deserialization we can also just have the individual parts
    returned.
    
    Signed-off-by: Christian Decker <decker.christian@gmail.com>
    Suggested-by: Rusty Russell <@rustyrussell>
    cdecker authored and rustyrussell committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    2db4f19 View commit details
    Browse the repository at this point in the history
  15. plugin: Added CHANGELOG entry and docs for the htlc_accepted hook

    Signed-off-by: Christian Decker <@cdecker>
    cdecker authored and rustyrussell committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    a57fdf2 View commit details
    Browse the repository at this point in the history
  16. gossip_store: mark private updates separately from normal ones.

    They're really gossipd-internal, and we don't want per-peer daemons
    to confuse them with normal updates.
    
    I don't bump the gossip_store version; that's coming with another update
    anyway.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    180a552 View commit details
    Browse the repository at this point in the history
  17. devtools/dump-gossipstore: print offsets.

    More useful if something is wrong.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    0fc97ed View commit details
    Browse the repository at this point in the history
  18. gossipd: track gossip_store locations of local channels.

    We currently don't care, but the next patch means we have to find them
    again.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    43f2cbd View commit details
    Browse the repository at this point in the history
  19. gossipd: disable gossip_store upgrade.

    We're about to bump version again, and the code to upgrade it was
    quite hairy (and buggy!).  It's not worthwhile for such a
    poorly-tested path: I will just add code to limit how much incoming
    gossip we get to avoid flooding when we upgrade, however.
    
    I also use a modern gossip_store version in our test_gossip_store_load
    test, instead of relying on the upgrade path.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    696dc6b View commit details
    Browse the repository at this point in the history
  20. gossipd: erase old entries from the store, don't just append.

    We use the high bit of the length field: this way we can still check
    that the checksums are valid on deleted fields.
    
    Once this is done, serially reading the gossip_store file will result
    in a complete, ordered, minimal gossip broadcast.  Also, the horrible
    corner case where we might try to delete things from the store during
    load time is completely gone: we only load non-deleted things.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    df00f20 View commit details
    Browse the repository at this point in the history
  21. channeld: don't queue gossip msgs while waiting for foreign_channel_u…

    …pdate.
    
    We ask gossipd for the channel_update for the outgoing channel; any other
    messages it sends us get queued for later processing.
    
    But this is overzealous: we can shunt those msgs to the peer while
    we're waiting.  This fixes a nasty case where we have to handle
    WIRE_GOSSIPD_NEW_STORE_FD messages by queuing the fd for later.
    
    This then means that WIRE_GOSSIPD_NEW_STORE_FD can be handled
    internally inside handle_gossip_msg(), since it's always dealt with
    the same, simplifying all callers.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    f1b4b14 View commit details
    Browse the repository at this point in the history
  22. common/per_per_state: generalize lightningd/peer_comm Part 1

    Encapsulating the peer state was a win for lightningd; not surprisingly,
    it's even more of a win for the other daemons, especially as we want
    to add a little gossip information.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    38d2899 View commit details
    Browse the repository at this point in the history
  23. gossipd: don't wrap messages when we send them to the peer.

    They already send *us* gossip messages, so they have to be distinct anyway.
    Why make us both do extra work?
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    a5f6ef3 View commit details
    Browse the repository at this point in the history
  24. gossipd: make writes to gossip_store atomic.

    There's a corner case where otherwise a reader could see the header and
    not the body of a message.  It could handle that in various ways,
    but simplest (and most efficient) is to avoid it happening.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    4399faf View commit details
    Browse the repository at this point in the history
  25. connectd: generate message for lightningd inside peer_connected().

    We used to generate this in the caller, then save it in case we needed
    to retry.  We're about to change the message we send to lightningd, so
    we'll need to regenerate it every time; just hand all the extra args
    into peer_connected() and we can generate the `connect_peer_connected`
    msg there.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    
    1diff --git a/connectd/connectd.c b/connectd/connectd.c
    index 94fe50b56..459c9ac63 100644
    rustyrussell committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    a40f45a View commit details
    Browse the repository at this point in the history
  26. gossipd: don't send gossip stream, let per-peer daemons read it thems…

    …elves.
    
    Keeping the uintmap ordering all the broadcastable messages is expensive:
    130MB for the million-channels project.  But now we delete obsolete entries
    from the store, we can have the per-peer daemons simply read that sequentially
    and stream the gossip itself.
    
    This is the most primitive version, where all gossip is streamed;
    successive patches will bring back proper handling of timestamp filtering
    and initial_routing_sync.
    
    We add a gossip_state field to track what's happening with our gossip
    streaming: it's initialized in gossipd, and currently always set, but
    once we handle timestamps the per-peer daemon may do it when the first
    filter is sent.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    5591c0b View commit details
    Browse the repository at this point in the history
  27. gossip_store: remove redundant copy_message.

    The single caller can easily use transfer_store_msg instead.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    bad9734 View commit details
    Browse the repository at this point in the history
  28. gossipd: add timestamp in gossip store header.

    (We don't increment the gossip_store version, since there are only a
    few commits since the last time we did this).
    
    This lets the reader simply filter messages; this is especially nice since
    the channel_announcement timestamp is *derived*, not in the actual message.
    
    This also creates a 'struct gossip_hdr' which makes the code a bit
    clearer.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    948490e View commit details
    Browse the repository at this point in the history
  29. devtools/create-gossipstore: write timestamps to the gossip_store.

    We need the timestamp for channel_announcement, but this is simplified
    because MCP always follows the channel_announcement by a channel_update.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    2abae05 View commit details
    Browse the repository at this point in the history
  30. common/gossip_store: handle timestamp filtering.

    This means we intercept the peer's gossip_timestamp_filter request
    in the per-peer subdaemon itself.  The rest of the semantics are fairly
    simple however.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    728bb4e View commit details
    Browse the repository at this point in the history
  31. gossipd/gossip_store: keep count of deleted entries, don't use bs->co…

    …unt.
    
    We didn't count some records before, so we could compare the two counters.
    This is much simpler, and avoids reliance on bs.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    5161b79 View commit details
    Browse the repository at this point in the history
  32. gossipd/gossip_store: fix compacting, don't use broadcast ordering.

    We have a problem: if we get halfway through writing the compacted store
    and run out of disk space, we've already changed half the indexes.
    
    This changes it so we do nothing until writing is finished: then we
    iterate through and update indexes.  It also weans us off broadcast
    ordering, which we can now eliminated.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    dd83453 View commit details
    Browse the repository at this point in the history
  33. gossipd: remove broadcast map altogether.

    This clarifies things a fair bit: we simply add and remove from the
    gossip_store directly.
    
    Before this series: (--disable-developer, -Og)
        store_load_msec:20669-20902(20822.2+/-82)
        vsz_kb:439704-439712(439706+/-3.2)
        listnodes_sec:0.890000-1.000000(0.92+/-0.04)
        listchannels_sec:11.960000-13.380000(12.576+/-0.49)
        routing_sec:3.070000-5.970000(4.814+/-1.2)
        peer_write_all_sec:28.490000-30.580000(29.532+/-0.78)
    
    After: (--disable-developer, -Og)
        store_load_msec:19722-20124(19921.6+/-1.4e+02)
        vsz_kb:288320
        listnodes_sec:0.860000-0.980000(0.912+/-0.056)
        listchannels_sec:10.790000-12.260000(11.65+/-0.5)
        routing_sec:2.540000-4.950000(4.262+/-0.88)
        peer_write_all_sec:17.570000-19.500000(18.048+/-0.73)
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    3e733af View commit details
    Browse the repository at this point in the history
  34. gossipd: trivial clean up of routing_add_channel_update.

    For some reason I was reluctant to use the hc local variable; I even
    re-declared it!
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    34c113a View commit details
    Browse the repository at this point in the history
  35. gossipd: Don't abort() on duplicate entries in gossip_store.

    Triggered by a previous variant of this PR, but a goo1d idea to simply
    discard the store in general when we get a duplicate entry.
    
    We crash trying to delete old ones, which means writing to the store.
    But they should have already been deleted.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    f8b98e0 View commit details
    Browse the repository at this point in the history
  36. gossip_store: don't leave dangling channel_announce if we truncate.

    (Or, if we crashed before we got to write out the channel_update).
    It's a corner case, but one reported by @darosior and reproduced
    on my test node (both with bad gossip_store due to previous iterations
    of this patchset!).
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    628b65f View commit details
    Browse the repository at this point in the history
  37. cli/lightning-cli: free eveything on exit.

    It's not required, but it means valgrind won't complain about leaks.
    
    Suggested-by: @m-schmoock
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    e902d9a View commit details
    Browse the repository at this point in the history

Commits on Jun 5, 2019

  1. newaddr: fix return value for deprecated "address" field.

    It would always return bech32; fix that, and don't bother printing
    it if they use the (new) 'all' parameter.
    
    This API was introduced in 3e67c09,
    which means it wasn't in a release so no CHANGELOG entry necessary.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and niftynei committed Jun 5, 2019
    Configuration menu
    Copy the full SHA
    ba036b7 View commit details
    Browse the repository at this point in the history

Commits on Jun 6, 2019

  1. Configuration menu
    Copy the full SHA
    dd87024 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c40250a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a4a1938 View commit details
    Browse the repository at this point in the history
  4. bitcoin/tx: script arg should be const.

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 6, 2019
    Configuration menu
    Copy the full SHA
    09d9abf View commit details
    Browse the repository at this point in the history
  5. common/withdraw_tx: tell caller where we put the change output.

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 6, 2019
    Configuration menu
    Copy the full SHA
    92da5ef View commit details
    Browse the repository at this point in the history
  6. bip32_pubkey: use more widely, don't open-code.

    As a side-effect, we now only add txfilters for addresses we actually
    expose, rather than always filtering for both p2sh and native segwit.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 6, 2019
    Configuration menu
    Copy the full SHA
    aa21eea View commit details
    Browse the repository at this point in the history
  7. lightningd: add json_add_tx helper.

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 6, 2019
    Configuration menu
    Copy the full SHA
    7e02fbe View commit details
    Browse the repository at this point in the history
  8. wallet: make withdraw parsing more strict.

    We generally want to do as much validation as possible inside
    parameter parsing, as that means the 'check' command detects more
    erroneous uses.  In this case, we can try to interpret the destination
    address as soon as we encounter it.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 6, 2019
    Configuration menu
    Copy the full SHA
    663315c View commit details
    Browse the repository at this point in the history
  9. wtx_select_utxos: use wallet_tx as our allocation context for utxos.

    We currently allocate utxos off cmd, but the next commit will persist a
    wtx beyond the command which created it, breaking that assumption.
    
    In general, a struct member should be owned by the struct itself, and
    a tal context should be an explicit arg, not implicit.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 6, 2019
    Configuration menu
    Copy the full SHA
    3b91a6f View commit details
    Browse the repository at this point in the history
  10. pytest: move wallet tests into new file tests/test_wallet.py

    We're going to add some more.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 6, 2019
    Configuration menu
    Copy the full SHA
    0543149 View commit details
    Browse the repository at this point in the history
  11. common/utxo: don't memleak script.

    We currently always free the tx, so we didn't notice, but the coming
    changes uncovered this leak.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 6, 2019
    Configuration menu
    Copy the full SHA
    ffa8463 View commit details
    Browse the repository at this point in the history
  12. wallet: keep a list of unreleased transactions.

    We're going to use this in the next patch.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 6, 2019
    Configuration menu
    Copy the full SHA
    1a3886c View commit details
    Browse the repository at this point in the history
  13. wallet: new commands 'txprepare', 'txsend' and 'txdiscard'.

    This allows you to prepare a tx, then release or discard it later.
    
    Shares almost all the code with json_withdraw (which is now technically
    superfluous).
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 6, 2019
    Configuration menu
    Copy the full SHA
    985048e View commit details
    Browse the repository at this point in the history
  14. pylightning: interfaces for txprepare/txsend/txdiscard.

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 6, 2019
    Configuration menu
    Copy the full SHA
    403b861 View commit details
    Browse the repository at this point in the history
  15. pytest: test txprepare/txdiscard/txsend.

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 6, 2019
    Configuration menu
    Copy the full SHA
    cdab75e View commit details
    Browse the repository at this point in the history
  16. pytest: test that we unreserve txprepare inputs across shutdown/crash.

    We fail this at the moment, since we rely on shutdown to do the cleanups
    for us.
    
    (Also had to fix the unclean shutdown path: the caller checks the rc unless
     mayfail is set, and of course it's not zero since we just SIGTERM'd it).
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 6, 2019
    Configuration menu
    Copy the full SHA
    65505ad View commit details
    Browse the repository at this point in the history
  17. wallet: clean reserved inputs on startup.

    We reserve inputs when we're going to send a transaction, but we don't
    unreserve them if we crash.  This is most graphically demonstrated by
    the txprepare case, which makes it easier to trigger.
    
    Instead, we should query bitcoind to see whether the tx made it out or
    not, as we would do manually with dev-rescan-outputs.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 6, 2019
    Configuration menu
    Copy the full SHA
    e1dbc0b View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    bbedd38 View commit details
    Browse the repository at this point in the history
  19. Travis: set all vars inside build.sh, and increase parallelism for DE…

    …VELOPER=0
    
    We currently set TIMEOUT and PYTEST_PAR in our Travis instance directly,
    which is a bit unhelpful.  In particular, parallelism should be increased
    when DEVELOPER isn't set since we spend 60 seconds waiting for gossip in
    many cases.
    
    If this doesn't stop timeouts, I'll have to mark more tests SLOW_MACHINE :(
    
    331.24s call     tests/test_connection.py::test_opening_tiny_channel
    245.45s call     tests/test_gossip.py::test_gossip_store_load_complex
    215.35s call     tests/test_invoices.py::test_invoice_routeboost
    194.04s call     tests/test_plugin.py::test_htlc_accepted_hook_forward_restart
    182.62s call     tests/test_plugin.py::test_htlc_accepted_hook_fail
    182.02s call     tests/test_plugin.py::test_htlc_accepted_hook_resolve
    182.01s call     tests/test_pay.py::test_pay_limits
    159.10s call     tests/test_gossip.py::test_gossip_notices_close
    153.94s call     tests/test_connection.py::test_peerinfo
    121.62s call     tests/test_invoices.py::test_invoice_preimage
    121.46s call     tests/test_gossip.py::test_gossipwith
    120.76s call     tests/test_pay.py::test_setchannelfee_all
    120.61s call     tests/test_connection.py::test_second_channel
    120.42s call     tests/test_closing.py::test_closing_id
    120.39s call     tests/test_gossip.py::test_gossip_addresses
    120.39s call     tests/test_gossip.py::test_gossip_weirdalias
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and cdecker committed Jun 6, 2019
    Configuration menu
    Copy the full SHA
    aaf41ad View commit details
    Browse the repository at this point in the history

Commits on Jun 7, 2019

  1. plugin: Add new notification type: warning

    This notification bases on `LOG_BROKEN` and `LOG_UNUSUAL` level log.
    
    --Introduction
    
    A notification for topic `warning` is sent every time a new `BROKEN`/
    `UNUSUAL` level(in plugins, we use `error`/`warn`) log generated, which
     means an unusual/borken thing happens, such as channel failed,
    message resolving failed...
    
    ```json
    {
    	"warning": {
    	"level": "warn",
    	"time": "1559743608.565342521",
    	"source": "lightningd(17652): 0821f80652fb840239df8dc99205792bba2e559a05469915804c08420230e23c7c chan #7854:",
    	"log": "Peer permanent failure in CHANNELD_NORMAL: lightning_channeld: sent ERROR bad reestablish dataloss msg"
      }
    }
    ```
    1. `level` is `warn` or `error`:
    `warn` means something seems bad happened and it's under control, but
    we'd better check it;
    `error` means something extremely bad is out of control, and it may lead
    to crash;
    
    2. `time` is the second since epoch;
    
    3. `source`, in fact, is the `prefix` of the log_entry. It means where
    the event happened, it may have the following forms:
    `<node_id> chan #<db_id_of_channel>:`, `lightningd(<lightningd_pid>):`,
    `plugin-<plugin_name>:`, `<daemon_name>(<daemon_pid>):`, `jsonrpc:`,
    `jcon fd <error_fd_to_jsonrpc>:`, `plugin-manager`;
    
    4. `log` is the context of the original log entry.
    
    --Note:
    
    1. The main code uses `UNUSUAL`/`BROKEN`, and plugin module uses `warn`
    /`error`, considering the consistency with plugin, warning choose `warn`
    /`error`. But users who use c-lightning with plugins may want to
    `getlog` with specified level when receive warning. It's the duty for
    plugin dev to turn `warn`/`error` into `UNUSUAL`/`BROKEN` and present it
     to the users, or pass it directly to `getlog`;
    
    2. About time, `json_log()` in `log` module uses the Relative Time, from
     the time when `log_book` inited to the time when this event happend.
     But I consider the `UNUSUAL`/`BROKEN` event is rare, and it is very
     likely to happen after running for a long time, so for users, they will
      pay more attention to Absolute Time.
    
    -- Related Change
    
    1. Remove the definitions of `log`, `log_book`, `log_entry` from `log.c`
    to `log.h`, then they can be used in warning declaration and definition.
    
    2. Remove `void json_add_time(struct json_stream *result, const char
    *fieldname, struct timespec ts)` from `log.c` to `json.c`, and add
    related declaration in `json.h`. Now the notification function in
    `notification.c` can call it.
    
    2. Add a pointer to `struct lightningd` in `struct log_book`. This may
    affect the independence of the `log` module, but storing a pointer to
    `ld` is more direct;
    trueptolemy authored and rustyrussell committed Jun 7, 2019
    Configuration menu
    Copy the full SHA
    231703c View commit details
    Browse the repository at this point in the history
  2. log: add 'warning' notification when log

    - Related Changes for `warning` notification
    
    Add a `bool` type parameter in `log_()` and `lov()`, this `bool` flag
     indicates if we should call `warning` notifier.
    
    1) The process of copying `log_book` of every peer to the `log_book` of
    `ld` is usually included in `log_()` and `lov()`, and it may lead to
    repeated `warning` notification. So a `bool`, which explicitly indicates
    if the `warning` notification is disabled during this call, is necessary
    .
    2) The `LOG_INFO` and `LOG_DEBUG` level don't need to call
    warning, so set that `bool` paramater as `FALSE` for these log level and
    only set it as `TRUE` for `LOG_UNUAUSL`/`LOG_BROKEN`. As for `LOG_IO`,
    it use `log_io()` to log, so we needn't think about notifier for it.
    trueptolemy authored and rustyrussell committed Jun 7, 2019
    Configuration menu
    Copy the full SHA
    96135da View commit details
    Browse the repository at this point in the history
  3. pytest: Add a test for the 'warning' subscription and notification

    1. Create a plugin: ./lightning/tests/plugins/pretend_badlog.py
    This plugin subscribes 'warning' notification and log the payload of
    'warning';
    2. Add a new test: tests/test_plugin.py::test_warning_notification
    This test runs the plugin-pretend_badlog.py and check if 'warning'
    notification can be normal triggered and subscribed.
    trueptolemy authored and rustyrussell committed Jun 7, 2019
    Configuration menu
    Copy the full SHA
    4d08ed2 View commit details
    Browse the repository at this point in the history
  4. doc: Add the description for 'warning' notification and add a CHANGEL…

    …OG entry
    trueptolemy authored and rustyrussell committed Jun 7, 2019
    Configuration menu
    Copy the full SHA
    1ca0eef View commit details
    Browse the repository at this point in the history
  5. pytest: fix test_hlcs_cltv_only_difference

    Broken by 909913c, but since Travis
    skips this test ("temporarily", according to the commit msg in January!)
    it wasn't caught.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and cdecker committed Jun 7, 2019
    Configuration menu
    Copy the full SHA
    a3b646b View commit details
    Browse the repository at this point in the history
  6. lightningd/channel_control: fix reached_announce_depth counting in pe…

    …er_start_channeld
    
    Fixes a corner case when reconnecting (which restarts channeld) at depth=6
    where we didn't correctly send/respond with announce_signatures.
    
    NOTE: A complete restart of node may initialize channeld with unupdated height
    because of an unfinished rescan. But when rescan is finished, funding tx_watch is
    fired (at least once), which then tells channeld the latest depth.
    SimonVrouwe authored and cdecker committed Jun 7, 2019
    Configuration menu
    Copy the full SHA
    a9dd690 View commit details
    Browse the repository at this point in the history
  7. pytest: add test_reconnect_remote_sends_no_sigs, which tests PR2619

    Remote node may (incorrectly) not send announcement_signatures when
    reconnecting, so we we use a copy and can still re-announce.
    Also checks that we still send our announcement_signatures when reconnecting.
    SimonVrouwe authored and cdecker committed Jun 7, 2019
    Configuration menu
    Copy the full SHA
    b1058df View commit details
    Browse the repository at this point in the history
  8. pytest: cleanup test_funding_reorg_remote_lags

    - mock_rpc function now returns full JSON-RPC response, is much cleaner
    - Since reached_announce_depth counting is fixed when starting
      channeld, we don't need the 7th block to tell depth anymore.
    SimonVrouwe authored and cdecker committed Jun 7, 2019
    Configuration menu
    Copy the full SHA
    ea8a508 View commit details
    Browse the repository at this point in the history
  9. lightningd/channel_control logline fixup

    channeld/channel_wire.csv add missing newline
    SimonVrouwe authored and cdecker committed Jun 7, 2019
    Configuration menu
    Copy the full SHA
    44d64c1 View commit details
    Browse the repository at this point in the history
  10. configure: fix --reconfigure, improve style, set defaults in one place.

    I noticed that DEVELOPER was being reset to 0 by ./configure --reconfigure;
    that's because we set the defaults first, then --reconfigure would only
    override *unset* vars.  We now set up defaults last.
    
    We unify all our "find the default" functions, to neaten them; in
    particular find_pytest and our open-coded valgrind testing function.
    
    We can figure out whether valgrind works using /bin/true instead of waiting
    until configurator is built.
    
    We're also more careful with ${FOO-default} vs ${FOO:-default}; the former
    does not replace if FOO is set to the empty string, which is possible for
    some of our settings (COPTFLAGS, CDEBUGFLAGS in particular).
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and cdecker committed Jun 7, 2019
    Configuration menu
    Copy the full SHA
    54b66f0 View commit details
    Browse the repository at this point in the history
  11. CHANGELOG: Fix typo in @cdecker's name.

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and cdecker committed Jun 7, 2019
    Configuration menu
    Copy the full SHA
    d65946a View commit details
    Browse the repository at this point in the history
  12. devtools/credit: script to highlight contributions for this commit.

    And update MAKING-RELEASES.md to refer to it
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and cdecker committed Jun 7, 2019
    Configuration menu
    Copy the full SHA
    0e7b26d View commit details
    Browse the repository at this point in the history
  13. txfilter: Migrate the list of owned scriptPubKeys into a hashset

    I was bumping against some blocksync performance issues with 12k+ keys, 24k+
    scriptpubkeys being checked against, and migrating that list to a hashset is
    an easy fix to shave off 99% of the time to process a block.
    
    Signed-off-by: Christian Decker <decker.christian@gmail.com>
    cdecker authored and rustyrussell committed Jun 7, 2019
    Configuration menu
    Copy the full SHA
    ec2ced1 View commit details
    Browse the repository at this point in the history

Commits on Jun 8, 2019

  1. Configuration menu
    Copy the full SHA
    9e98d01 View commit details
    Browse the repository at this point in the history
  2. db: Add channel_id and type to the transactions table

    Mainly used to differentiate channel-related transactions from on-chain wallet
    transactions. Will be used to filter `listtransaction` results and bundle
    transactions that belong to the same channel.
    
    Signed-off-by: Christian Decker <decker.christian@gmail.com>
    cdecker authored and rustyrussell committed Jun 8, 2019
    Configuration menu
    Copy the full SHA
    1e2291c View commit details
    Browse the repository at this point in the history
  3. wallet: Add function to annotate transactions aposteriori

    Since we add the transactions while processing the blockchain, and before we
    have enough context to annotate them correctly, i.e., in the txwatches, we add
    them first and then annotate them aposteriori.
    
    Signed-off-by: Christian Decker <decker.christian@gmail.com>
    cdecker authored and rustyrussell committed Jun 8, 2019
    Configuration menu
    Copy the full SHA
    ad4b920 View commit details
    Browse the repository at this point in the history
  4. channel: Along with the last_tx also remember its type

    This takes the guesswork out of `drop_to_chain` and allows us to annotate the
    last_tx consistently.
    
    Signed-off-by: Christian Decker <decker.christian@gmail.com>
    cdecker authored and rustyrussell committed Jun 8, 2019
    Configuration menu
    Copy the full SHA
    4c57d44 View commit details
    Browse the repository at this point in the history
  5. chaintopology: Annotate transactions as deposits if we owned outputs

    Signed-off-by: Christian Decker <decker.christian@gmail.com>
    cdecker authored and rustyrussell committed Jun 8, 2019
    Configuration menu
    Copy the full SHA
    771ff1f View commit details
    Browse the repository at this point in the history
  6. wallet: Store and annotate withdrawals in the DB

    We weren't storing them so far, which is sub-optimal :-)
    
    Signed-off-by: Christian Decker <decker.christian@gmail.com>
    cdecker authored and rustyrussell committed Jun 8, 2019
    Configuration menu
    Copy the full SHA
    04c255f View commit details
    Browse the repository at this point in the history
  7. wallet: Annotate funding transaction in the database

    Signed-off-by: Christian Decker <decker.christian@gmail.com>
    cdecker authored and rustyrussell committed Jun 8, 2019
    Configuration menu
    Copy the full SHA
    7f898aa View commit details
    Browse the repository at this point in the history
  8. onchaind: Store and annotate close transaction when we drop to chain

    Signed-off-by: Christian Decker <decker.christian@gmail.com>
    cdecker authored and rustyrussell committed Jun 8, 2019
    Configuration menu
    Copy the full SHA
    05dbf1a View commit details
    Browse the repository at this point in the history
  9. onchaind: Store and annotate transactions we broadcast ourselves

    Signed-off-by: Christian Decker <decker.christian@gmail.com>
    cdecker authored and rustyrussell committed Jun 8, 2019
    Configuration menu
    Copy the full SHA
    ae0bc4a View commit details
    Browse the repository at this point in the history
  10. onchaind: Allow onchaind to annotate transactions we watch

    This is important for things we automatically watched because it spends a
    watch txo, but only onchaind knows the details about what the TX really is and
    how it should be handled.
    
    Signed-off-by: Christian Decker <decker.christian@gmail.com>
    cdecker authored and rustyrussell committed Jun 8, 2019
    Configuration menu
    Copy the full SHA
    a54b7da View commit details
    Browse the repository at this point in the history
  11. onchaind: Have onchaind annotate htlc-{succes,failure} and penalties

    Signed-off-by: Christian Decker <decker.christian@gmail.com>
    cdecker authored and rustyrussell committed Jun 8, 2019
    Configuration menu
    Copy the full SHA
    94e024a View commit details
    Browse the repository at this point in the history
  12. onchaind: Annotate their sweep transactions

    Signed-off-by: Christian Decker <decker.christian@gmail.com>
    cdecker authored and rustyrussell committed Jun 8, 2019
    Configuration menu
    Copy the full SHA
    49a0de7 View commit details
    Browse the repository at this point in the history
  13. openingd: Annotate our own funding transaction

    Signed-off-by: Christian Decker <decker.christian@gmail.com>
    cdecker authored and rustyrussell committed Jun 8, 2019
    Configuration menu
    Copy the full SHA
    61a28cc View commit details
    Browse the repository at this point in the history
  14. onchaind: Have onchaind annotate unilateral, cheat and mutual closes

    onchaind knows best, no need to guess outside.
    
    Signed-off-by: Christian Decker <decker.christian@gmail.com>
    cdecker authored and rustyrussell committed Jun 8, 2019
    Configuration menu
    Copy the full SHA
    605358f View commit details
    Browse the repository at this point in the history
  15. wallet: Add function to retrieve transactions from the wallet

    Signed-off-by: Christian Decker <decker.christian@gmail.com>
    cdecker authored and rustyrussell committed Jun 8, 2019
    Configuration menu
    Copy the full SHA
    6efb1c0 View commit details
    Browse the repository at this point in the history
  16. json-rpc: Add listtransactions RPC method

    Signed-off-by: Christian Decker <decker.christian@gmail.com>
    cdecker authored and rustyrussell committed Jun 8, 2019
    Configuration menu
    Copy the full SHA
    3c777fa View commit details
    Browse the repository at this point in the history
  17. wallet: Rip out the txtypes type in favor of enum wallet_tx_type

    Suggested-by: Rusty Russell <@rustyrussell>
    Signed-off-by: Christian Decker <decker.christian@gmail.com>
    cdecker authored and rustyrussell committed Jun 8, 2019
    Configuration menu
    Copy the full SHA
    b6b548a View commit details
    Browse the repository at this point in the history

Commits on Jun 9, 2019

  1. pytest: test for duplicate update_fee spam.

    Reported-by: @pm47
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 9, 2019
    Configuration menu
    Copy the full SHA
    d344f9d View commit details
    Browse the repository at this point in the history
  2. channeld: don't send feerate spam if we can't set it as high as we want.

    @pm47 gave a great bug report showing c-lightning sending the same
    UPDATE_FEE over and over, with the final surprise result being that we
    blamed the peer for sending us multiple empty commits!
    
    The spam is caused by us checking "are we at the desired feerate?" but
    then if we can't afford the desired feerate, setting the feerate we
    can afford, even though it's a duplicate.  Doing the feerate cap before
    we test if it's what we have already eliminates this.
    
    But the empty commits was harder to find: it's caused by a heuristic in
    channel_rcvd_revoke_and_ack:
    
    ```
    	/* For funder, ack also means time to apply new feerate locally. */
    	if (channel->funder == LOCAL &&
    	    (channel->view[LOCAL].feerate_per_kw
    	     != channel->view[REMOTE].feerate_per_kw)) {
    		status_trace("Applying feerate %u to LOCAL (was %u)",
    			     channel->view[REMOTE].feerate_per_kw,
    			     channel->view[LOCAL].feerate_per_kw);
    		channel->view[LOCAL].feerate_per_kw
    			= channel->view[REMOTE].feerate_per_kw;
    		channel->changes_pending[LOCAL] = true;
    	}
    ```
    
    We assume we never send duplicates, so we detect an otherwise-empty
    change using the difference in feerates.  If we don't set this flag,
    we will get upset if we receive a commitment_signed since we consider
    there to be no changes to commit.
    
    This is actually hard to test: the previous commit adds a test which
    spams update_fee and doesn't trigger this bug, because both sides
    use the same "there's nothing outstanding" logic.
    
    Fixes: ElementsProject#2701
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 9, 2019
    Configuration menu
    Copy the full SHA
    6f015b6 View commit details
    Browse the repository at this point in the history
  3. json: Add wrapper to add a secret to a JSON result

    Signed-off-by: Christian Decker <decker.christian@gmail.com>
    cdecker authored and rustyrussell committed Jun 9, 2019
    Configuration menu
    Copy the full SHA
    c91483f View commit details
    Browse the repository at this point in the history
  4. plugin: Use the json_add_secret wrapper to add the shared_secret

    This was incorrectly handled before, hence the wrapper which checks
    correctness of the arguments.
    
    Signed-off-by: Christian Decker <decker.christian@gmail.com>
    cdecker authored and rustyrussell committed Jun 9, 2019
    Configuration menu
    Copy the full SHA
    9e511cb View commit details
    Browse the repository at this point in the history

Commits on Jun 10, 2019

  1. Configuration menu
    Copy the full SHA
    42d6bf5 View commit details
    Browse the repository at this point in the history
  2. gossip: bump version to remove lingering issues with master.

    There were several gossip breakages in master; bumping version means
    upgrades get a clean store (not just those upgrading from stable version).
    
    Fixes: ElementsProject#2719
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and cdecker committed Jun 10, 2019
    Configuration menu
    Copy the full SHA
    db0a285 View commit details
    Browse the repository at this point in the history

Commits on Jun 11, 2019

  1. Configuration menu
    Copy the full SHA
    4a242ed View commit details
    Browse the repository at this point in the history
  2. listchannels: add htlc_minimum_msat and htlc_maximum_msat fields.

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 11, 2019
    Configuration menu
    Copy the full SHA
    b48c644 View commit details
    Browse the repository at this point in the history
  3. tests: add plugin for simple invoice delay.

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 11, 2019
    Configuration menu
    Copy the full SHA
    380c044 View commit details
    Browse the repository at this point in the history
  4. pytest: move test_channel_drainage to test_pay.py

    This is where payment tests should go.  Also mark it xfail for the moment,
    and remove developer-only tag (propagating gossip is only 60 seconds, which
    is OK).
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 11, 2019
    Configuration menu
    Copy the full SHA
    409368e View commit details
    Browse the repository at this point in the history
  5. pytest: extract separate tests that spendable_msat is accurate.

    Turns out we needed more comprehensive testing; we ended up with three
    separate tests.  To avoid changing test_channel_drainage as we fix
    spendable_msat, I substituted raw numbers there.
    
    The first is a variation of the existing tests, testing we can't
    exceed spendable_msat, and we can pay it, both ways.
    
    The second is with a larger amount, which triggers a different problem.
    
    The final is with a giant channel, which tests our 2^32-1 msat cap.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 11, 2019
    Configuration menu
    Copy the full SHA
    7b7d46c View commit details
    Browse the repository at this point in the history
  6. channeld: extract HTLC trim logic into common.

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 11, 2019
    Configuration menu
    Copy the full SHA
    e7778a0 View commit details
    Browse the repository at this point in the history
  7. lightningd: make 'spendable_msatoshi' more realistic.

    Take into account the fee we'd have to pay if we're the funder, and
    also drop to 0 if the amount is less than the smallest HTLC the peer
    will accept.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 11, 2019
    Configuration menu
    Copy the full SHA
    ad24d94 View commit details
    Browse the repository at this point in the history
  8. gossipd: don't charge ourselves fees when calculating route.

    This means there's now a semantic difference between the default `fromid`
    and setting `fromid` explicitly to our own node_id.  In the default case,
    it means we don't charge ourselves fees on the route.
    
    This means we can spend the full channel balance.
    
    We still want to consider the pricing of local channels, however:
    there's a *reason* to discount one over another, and that is to bias
    things.  So we add the first-hop fee to the *risk* value instead.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 11, 2019
    Configuration menu
    Copy the full SHA
    ab31f40 View commit details
    Browse the repository at this point in the history
  9. lightningd: take into account outstanding HTLCs for 'spendable_msat'

    The current calculation ignores them, which is unrealistic.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 11, 2019
    Configuration menu
    Copy the full SHA
    bb6c34f View commit details
    Browse the repository at this point in the history
  10. lightningd: don't let spendable_msat go wumbo.

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 11, 2019
    Configuration menu
    Copy the full SHA
    0448608 View commit details
    Browse the repository at this point in the history
  11. channeld: don't subtract both reserves from advertized htlc_max.

    Subtracting both arbitrarily reduces our capacity, even for ourselves
    since the routing logic uses this maximum.
    
    I also changed 'advertise' to 'advertize', since we use american
    spelling.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 11, 2019
    Configuration menu
    Copy the full SHA
    431401a View commit details
    Browse the repository at this point in the history
  12. channeld: don't add HTLCs if that would drive us negative.

    We track whether each change is affordable as we go;
    test_channel_drainage got us so close that the difference mattered; we
    hit an assert when we tried to commit the tx and realized we couldn't
    afford it.
    
    We should not be trying to add an HTLC if it will result in the funder
    being unable to afford it on either the local *or remote* commitments.
    
    Note the test still "fails" because it refuses to send the final
    payment.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 11, 2019
    Configuration menu
    Copy the full SHA
    1275928 View commit details
    Browse the repository at this point in the history
  13. pytest: simplify and annotate test_channel_drainage.

    Remove gratuitous prints, add explanations of what's going on,
    and demonstrate that we can add a final trimmed HTLC but not
    a non-trimmed one.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 11, 2019
    Configuration menu
    Copy the full SHA
    db22d2b View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    ca4b07c View commit details
    Browse the repository at this point in the history
  15. fundchannel: Add a new 'utxo' parameter

    This new parameter takes a list of outpoints (as txid:vout) and fund a channel from the corresponding utxos.
    Example : fundchannel <id> 10000 normal 1 [10767f0db0e568127fffd7f70a154d4599f42d62babf63230a7c3378bfce3cb0:0, c9e040e0b5fc8c59d5e7834108fbc5583001f414dd83faf0a05cff9d1a92d32c:0]
    darosior authored and rustyrussell committed Jun 11, 2019
    Configuration menu
    Copy the full SHA
    ac038b3 View commit details
    Browse the repository at this point in the history
  16. fundchannel: Update the manpage and Pylightning's method

    Add the new 'utxo' parameter to both
    darosior authored and rustyrussell committed Jun 11, 2019
    Configuration menu
    Copy the full SHA
    1b29b06 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    2436214 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    7ce4fcd View commit details
    Browse the repository at this point in the history
  19. ccan: update to faster and correct crc32c implementation.

    I decided to try a faster implementation, only to find our crc32c was
    not correct!  Ouch.
    
    I removed the crc32c functions from ccan/crc, and added a new crc32c
    module which has the Mark Adler x86-64-optimized variants.
    
    We bump gossip_store version again, since csums have changed.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 11, 2019
    Configuration menu
    Copy the full SHA
    0d2a483 View commit details
    Browse the repository at this point in the history

Commits on Jun 12, 2019

  1. gossipd: note if loaded store seems reasonably up-to-date.

    If not, we can ask peers for full gossip (for now we just set a flag).
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    21c920a View commit details
    Browse the repository at this point in the history
  2. gossipd: prepare for internally-generated short-channel-id queries.

    Up until now we only generated these in dev mode for testing.  Hoist
    into common code, turn counter into a flag (we're only allowed one!)
    and note if query is internal or not.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    5ef7aa7 View commit details
    Browse the repository at this point in the history
  3. gossipd: APIs return more information about routing message handling.

    In particular, we'll need to know the short_channel_id if a
    channel_update is unknown (implies we're missing a channel), and whether
    processing a pending channel_announcement was successful (implies that
    the channel was real).
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    18069ab View commit details
    Browse the repository at this point in the history
  4. gossipd: query unknown short_channel_ids, note if they were really mi…

    …ssing.
    
    The first sign that we're missing gossip is that we get a channel_update
    for an unknown channel.  The peer might be wrong (or lying), but if it turns
    out to be a real channel, we were definitely missing something.
    
    This patch does two things: queries when we get an unknown channel_update,
    and then notes that a channel_announcement was from such an update when
    it's finally processed.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    b905376 View commit details
    Browse the repository at this point in the history
  5. gossipd: reset gossip_missing if no reports for 10 minutes.

    An arbitrary timeout.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    f5ea57d View commit details
    Browse the repository at this point in the history
  6. gossipd: control gossip level so we don't get flooded by peers.

    We seek a certain number of peers at each level of gossip; 3 "flood"
    if we're missing gossip, 2 at 24 hours past to catch recent gossip, and
    8 with current gossip.  The rest are given a filter which causes them
    not to gossip to us at all.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    6830233 View commit details
    Browse the repository at this point in the history
  7. gossipd: adjust gossip filters if we discover we're missing gossip.

    We pick up to three random peers and ask them to gossip more.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    1e32b4a View commit details
    Browse the repository at this point in the history
  8. plugins/pay: fix attempt counter on failure message.

    An "attempt" is when we actually try to send, not every route lookup
    we do.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    260febd View commit details
    Browse the repository at this point in the history
  9. plugins/pay: don't retry routehint if it contains already-eliminated …

    …channel.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    26cdf9d View commit details
    Browse the repository at this point in the history
  10. ccan: import ccan/json_out and ccan/json_escape.

    These are generalized from our internal implementations.
    
    The main difference is that 'struct json_escaped' is now 'struct
    json_escape', so we replace that immediately.
    
    The difference between lightningd's json-writing ringbuffer and the
    more generic ccan/json_out is that the latter has a better API and
    handles escaping transparently if something slips through (though
    it does offer direct accessors so you can mess things up yourself!).
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    220449e View commit details
    Browse the repository at this point in the history
  11. libplugin: use json_out internally.

    Since this handles escaping for us, this automatically fixes our previous
    escaping issued.
    
    Fixes: ElementsProject#2612
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    c77e29c View commit details
    Browse the repository at this point in the history
  12. libplugin: update API to use json_out.

    We now hand around struct json_out members, rather than using formatted
    strings, so plugins need to construct them properly.
    
    There's no automatic conversion between ' and " any more, so those
    are eliminated too.  pay still uses some manual construction of elements.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    c585f22 View commit details
    Browse the repository at this point in the history
  13. plugins/pay: use proper JSON construction for failure paths.

    The string cut & paste hack was nasty; make ->failure a json_out
    object so we can splice it in properly.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    0e336ac View commit details
    Browse the repository at this point in the history
  14. lightningd: have json_stream_success start the "result" object.

    "result" should always be an object (so that we can add new fields),
    so make that implicit in json_stream_success.
    
    This makes our primitives well-formed: we previously used NULL as our
    fieldname when calling the first json_object_start, which is a hack
    since we're actually in an object and the fieldname is 'result' (which
    was already written by json_object_start).
    
    There were only two cases which didn't do this:
    1. dev-memdump returned an array.  No API guarantees on this.
    2. shutdown returned a string.
    
    I temporarily made shutdown return an empty object, which shouldn't
    break anything, but I want to fix that later anyway.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    bb7bbd0 View commit details
    Browse the repository at this point in the history
  15. pylightning: remove 0.6.2 JSON compat wedge.

    The next commit breaks it: `if b' }\n' not in buff:` is always true since
    we're about to clean up our JSON so there won't be a space.  I could have
    hacked the space in our JSON, but 6 months is long enough anyway.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    adc4bf1 View commit details
    Browse the repository at this point in the history
  16. lightningd: tighten interal json_stream API.

    Move it closer to ccan/json_out, in preparation for using that as a
    replacement.
    
    In particular:
    
    1. Add a 'quote' field in json_add_member.
    2. json_add_member now always escapes if 'quote' is true.
    3. json_member_direct is exposed to allow avoiding of escaping.
    4. json_add_hex can use this, so no longer needs to be in json_stream.c.
    5. We don't make JSON manually, but always use helpers.
    6. We now flush the stream (wake reader) only when we close it, or mark
       command as pending.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    7f75043 View commit details
    Browse the repository at this point in the history
  17. lightningd: use ccan/json_out.

    This is now a fairly simple transition, which only effects the internals
    of json_stream.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    d817735 View commit details
    Browse the repository at this point in the history
  18. jsonrpc: don't return "stop" until we actually have freed resources.

    This is a painpoint with testing, that there's a noticable delay between
    "Shutting down" from lightning-cli and being able to restart lightningd.
    
    This fixes that by creating a canned response for this case, which is
    simply written out immediately before exit.  At this point, the pidfile
    has been deleted, the sockets have been closed, and the database
    has been closed.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    c6ec944 View commit details
    Browse the repository at this point in the history
  19. plugin: don't call notification after free.

    This is an old bug, where a plugin can get called while we're shutting
    down (and have freed plugins), but it's triggered more reliably by the
    new warning notification hook.
    
    For good measure, we also make freeing a plugin self-delete.
    
    Valgrind error file: valgrind-errors.16763
    ==16886== Invalid read of size 8
    ==16886==    at 0x422919: plugins_notify (plugin.c:1096)
    ==16886==    by 0x413919: notify_warning (notification.c:61)
    ==16886==    by 0x412BDE: logv (log.c:251)
    ==16886==    by 0x412A98: log_ (log.c:311)
    ==16886==    by 0x4044BE: bcli_finished (bitcoind.c:178)
    ==16886==    by 0x459480: destroy_conn (poll.c:244)
    ==16886==    by 0x459499: destroy_conn_close_fd (poll.c:250)
    ==16886==    by 0x4619E1: notify (tal.c:235)
    ==16886==    by 0x461A7E: del_tree (tal.c:397)
    ==16886==    by 0x461AB5: del_tree (tal.c:407)
    ==16886==    by 0x461AB5: del_tree (tal.c:407)
    ==16886==    by 0x461AB5: del_tree (tal.c:407)
    ==16886==  Address 0x634a578 is 40 bytes inside a block of size 352 free'd
    ==16886==    at 0x4C2EDEB: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
    ==16886==    by 0x461AFD: del_tree (tal.c:416)
    ==16886==    by 0x461FB7: tal_free (tal.c:481)
    ==16886==    by 0x411E0A: main (lightningd.c:841)
    ==16886==  Block was alloc'd at
    ==16886==    at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
    ==16886==    by 0x4617CE: allocate (tal.c:245)
    ==16886==    by 0x461E4C: tal_alloc_ (tal.c:423)
    ==16886==    by 0x42255E: plugins_new (plugin.c:106)
    ==16886==    by 0x41133D: new_lightningd (lightningd.c:218)
    ==16886==    by 0x411AD4: main (lightningd.c:649)
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    5a520f4 View commit details
    Browse the repository at this point in the history
  20. common: pull out scriptPubkey address method

    We're going to need this for P2WSH scripts. pull it out into
    a common file plus adopt the sanity checks so that it will allow for
    either P2WSH or P2WPKH (previously only encoded P2WPKH scripts)
    niftynei authored and rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    a9d0550 View commit details
    Browse the repository at this point in the history
  21. json: correct error message for param parser

    Looks like copy-paste from another commit didn't update
    the field for this
    niftynei authored and rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    eb0b3d7 View commit details
    Browse the repository at this point in the history
  22. tests: default all addresses to bech32

    Needed for composing a transaction externally to c-lightning, using
    bitcoind util.
    niftynei authored and rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    1b2a593 View commit details
    Browse the repository at this point in the history
  23. openingd: allow funding_failed to complete successfully

    For the `fundchannel_cancel` we're going to want
    to 'successfully' fail a funding channel operation. This allows
    us to report it a failure back as an RPC success, instead of
    automatically failing the RPC request.
    niftynei authored and rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    846bc9c View commit details
    Browse the repository at this point in the history
  24. opening: add entry point for `funding_start rpc command

    Beginnings of wiring up the funding_start rpc command. missing
    the part that actually starts the funding channel dance.
    niftynei authored and rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    8103acd View commit details
    Browse the repository at this point in the history
  25. openingd: pull out setup funder checks into separate method

    Useful for adding the funder_start stuff
    niftynei authored and rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    685aa47 View commit details
    Browse the repository at this point in the history
  26. opening: wire up walking through open channel up thru accept

    Fill in details to make fundchannel_start work.
    niftynei authored and rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    5920e65 View commit details
    Browse the repository at this point in the history
  27. pylightning: add fundchannel_start

    Add method to rpc handler
    niftynei authored and rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    23e7846 View commit details
    Browse the repository at this point in the history
  28. openingd: update billboard with funding info

    Make it easier for a user to know what's going on with
    a channel in `listpeers`.
    niftynei authored and rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    6e5928a View commit details
    Browse the repository at this point in the history
  29. opening: stash amount outside of the wtx

    Some channels won't be opened with a wtx struct, so keep
    the total funding amount separate from it so we can
    show some stats for listpeers.
    
    Note that we're going to need to update/confirm this once
    the transaction gets confirmed.
    niftynei authored and rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    52042bd View commit details
    Browse the repository at this point in the history
  30. lightningd: add start for fundchannel_continue

    Add an RPC method (not working at the moment) called
    `fundchannel_continue` that takes as its parameters a
    node_id and a txid for a transaction (that ostensibly has an output
    for a channel)
    niftynei authored and rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    dd11d3b View commit details
    Browse the repository at this point in the history
  31. test: add initial tests for starting an external fundchannel

    Test for getting through the address generation portion.
    niftynei authored and rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    b0b813a View commit details
    Browse the repository at this point in the history
  32. fundchannel: add txout field to RPC/API

    We'll need the outpoint for the funding output.
    niftynei authored and rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    7ea21c3 View commit details
    Browse the repository at this point in the history
  33. funding: add a 'inflight' marker

    We need a way to gate allowing continue to proceed or not
    niftynei authored and rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    8a60caa View commit details
    Browse the repository at this point in the history
  34. funding: wire up funding_continue

    Big wiring re-org for funding-continue
    
    In openingd, we move the 'persistent' state (their basepoints,
    pubkey, and the minimum_depth requirement for the opening tx) into
    the state object. We also look to keep code-reuse between
    'continue' and normal 'fundchannel' as high as possible. Both
    of these call the same 'fundchannel_reply' at the end.
    
    In opening_control.c, we remap fundchannel_reply such that it is
    now aware of the difference between an external/internally funded
    channel open. It's the same return path, with the difference that
    one finishes making and broadcasting the funding transaction; the
    other is skips this.
    niftynei authored and rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    478762d View commit details
    Browse the repository at this point in the history
  35. opening: add fundchannel_cancel command

    Provide the option to cancel a funding-opening with a peer.
    Must either call `fundchannel_cancel` or `fundchannel_continue`
    niftynei authored and rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    5aad642 View commit details
    Browse the repository at this point in the history
  36. tests: finish up test for external funding flow

    Add to test for fundchannel with composing and broadcasting
    an external transaction.
    niftynei authored and rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    3ae78a6 View commit details
    Browse the repository at this point in the history
  37. funding: rename fundchannel_continue -> _complete

    Renaming. "complete" more accurately describes what we're doing here.
    niftynei authored and rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    c00e0d2 View commit details
    Browse the repository at this point in the history
  38. funding: update CHANGELOG with new RPC calls

    Let people know what's changed
    niftynei authored and rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    388f31a View commit details
    Browse the repository at this point in the history
  39. doc: add manpages for fundchannel_[start,complete,cancel]

    Manpages for the manpage-god!!
    niftynei authored and rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    c0475d0 View commit details
    Browse the repository at this point in the history
  40. openingd: fix compile error caused by merge.

    Compile broke because we were using low-level JSON primitives here
    (which, incidentally, would produce bad JSON now, since we can't just
    put a raw string inside an object!).
    
    Use json_add_string, which also has the benefit of escaping JSON
    for us.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    4c118bc View commit details
    Browse the repository at this point in the history
  41. openingd_control: fix merge error with json_stream_success.

    That was changed to start the response object, which broke the openingd
    code once we merged.
    
    Of course, I should have *renamed it* when I changed the semantic!
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 12, 2019
    Configuration menu
    Copy the full SHA
    e9ff8e4 View commit details
    Browse the repository at this point in the history

Commits on Jun 13, 2019

  1. lightningd: fix bogus channel iteration on setchannelfee

    Setting channel to NULL then iterating doesn't work!
    
    Fixes: ElementsProject#2733
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 13, 2019
    Configuration menu
    Copy the full SHA
    67eb26c View commit details
    Browse the repository at this point in the history
  2. gossipd: don't catch pending node_announcements more than once.

    We catch node_announcements for nodes where we haven't finished
    analyzing the channel_announcement yet (either because we're still
    checking UTXO, or in this case, because we're waiting for a channel_update).
    
    But we reference count the pending_node_announce, so if we have
    multiple channels pending, we might try to insert it twice.  Clear it
    so this doesn't happen.
    
    There's a second bug where we continue to catch node_announcements
    until *all* the channel_announcements are no longer pending; this is fixed
    by removing it from the map.
    
    Fixes: ElementsProject#2735
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 13, 2019
    Configuration menu
    Copy the full SHA
    745634d View commit details
    Browse the repository at this point in the history
  3. CHANGELOG.md: reorder with most impactful changes at top.

    And reword a few for consistency.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 13, 2019
    Configuration menu
    Copy the full SHA
    bbbe2f5 View commit details
    Browse the repository at this point in the history
  4. CHANGELOG: Unreleased -> rc1

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 13, 2019
    Configuration menu
    Copy the full SHA
    ea1c52f View commit details
    Browse the repository at this point in the history

Commits on Jun 14, 2019

  1. pytest: add (xfail) test for store load miscount.

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 14, 2019
    Configuration menu
    Copy the full SHA
    12a523f View commit details
    Browse the repository at this point in the history
  2. gossipd: count deleted records correctly when loading gossip_store.

    The result of an incorrect count was that we failed on next compaction.
    
    Fixes: ElementsProject#2743
    Fixes: ElementsProject#2742
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 14, 2019
    Configuration menu
    Copy the full SHA
    eb5cc47 View commit details
    Browse the repository at this point in the history
  3. gossipd: gossip_store errors after rewrite are fatal.

    We can't continue, since we've moved the indexes.  We'll just crash
    anyway, as seen from bugs ElementsProject#2742 and ElementsProject#2743.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 14, 2019
    Configuration menu
    Copy the full SHA
    24cc371 View commit details
    Browse the repository at this point in the history
  4. CHANGELOG.md: v0.7.1rc2

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 14, 2019
    Configuration menu
    Copy the full SHA
    57405d7 View commit details
    Browse the repository at this point in the history

Commits on Jun 15, 2019

  1. Configuration menu
    Copy the full SHA
    8edf55b View commit details
    Browse the repository at this point in the history
  2. pytest: gossip_store test for node_announcement before update.

    We pass, but this test should have been added a while ago with the fix.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and cdecker committed Jun 15, 2019
    Configuration menu
    Copy the full SHA
    909f22f View commit details
    Browse the repository at this point in the history
  3. pytest: gossip_store test for channel_amount truncated.

    We pass, but this test should have been added a while ago with the
    original code.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and cdecker committed Jun 15, 2019
    Configuration menu
    Copy the full SHA
    a35ab51 View commit details
    Browse the repository at this point in the history
  4. pytest: add test for dangling channel_announcement/node_announcement …

    …after gossip_store.
    
    This can happen if the store was truncated.
    
    Reported-by: @jb55
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and cdecker committed Jun 15, 2019
    Configuration menu
    Copy the full SHA
    adc52b6 View commit details
    Browse the repository at this point in the history
  5. gossip_store: clean up a truncated store.

    We might have channel_announcements which have no channel_update: normally
    these don't get written into the store until there is one, but if the
    store was truncated it can happen.  We then get upset on compaction, since
    we don't have an in-memory representation of the channel_announcement.
    
    Similarly, we leave the node_announcement pending until after that
    channel_announcement, leading to a similar case.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and cdecker committed Jun 15, 2019
    Configuration menu
    Copy the full SHA
    10c503b View commit details
    Browse the repository at this point in the history
  6. gossipd: delete channel_amount from the store when we delete channel_…

    …announcement.
    
    Otherwise we slowly build up cruft: compaction simply moves them since
    they're not deleted.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and cdecker committed Jun 15, 2019
    Configuration menu
    Copy the full SHA
    5e3690b View commit details
    Browse the repository at this point in the history

Commits on Jun 17, 2019

  1. plugins doc: remove the 'only string options' warning

    int and bool are now also accepted ! :)
    darosior authored and rustyrussell committed Jun 17, 2019
    Configuration menu
    Copy the full SHA
    da676ba View commit details
    Browse the repository at this point in the history
  2. lightningd: restore ' ' before '}' for older pylightning.

    It needs this in compat mode to detect old (pre-0.6.3) end of JSON.
    But it always does the first command in compat mode.
    
    This was never really reliable, since the first command could be to
    a plugin for which we simply pass through the JSON (though, carefully
    appending the expected '\n\n' if not already there).
    
    Reported-by: @laanwj
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and cdecker committed Jun 17, 2019
    Configuration menu
    Copy the full SHA
    841fba7 View commit details
    Browse the repository at this point in the history

Commits on Jun 18, 2019

  1. CHANGELOG.md: note the db_write hook and listtransactions command.

    Reported-by: @cdecker
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 18, 2019
    Configuration menu
    Copy the full SHA
    77018e6 View commit details
    Browse the repository at this point in the history
  2. connect test: use wait_for_log in test_funding_external_wallet

    test_funding_external_wallet is flakey because we don't wait for
    the channel state to update before asserting that it's changed.
    niftynei authored and rustyrussell committed Jun 18, 2019
    Configuration menu
    Copy the full SHA
    92bd3a3 View commit details
    Browse the repository at this point in the history

Commits on Jun 20, 2019

  1. gossipd: truncate gossip_store.tmp for compaction.

    If something went wrong and there was an old one, we were
    appending to it!
    
    Reported-by: @SimonVrouwe
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 20, 2019
    Configuration menu
    Copy the full SHA
    47b5f2e View commit details
    Browse the repository at this point in the history

Commits on Jun 21, 2019

  1. bitcoin/tx: separate assertions.

    This might help diagnose what's happening with ElementsProject#2759
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 21, 2019
    Configuration menu
    Copy the full SHA
    711762e View commit details
    Browse the repository at this point in the history
  2. bitcoin/tx: use fromwire_fail in pull_bitcoin_tx.

    This is the correct way to mark failure: it also sets *max to 0.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 21, 2019
    Configuration menu
    Copy the full SHA
    f1b5706 View commit details
    Browse the repository at this point in the history
  3. common/gossip_store: handle short reads.

    This happened on Travis, and the gossip_store was a suspicious 4096
    bytes long.  This implies they're using some non-atomic filesystem
    (gossipd always does atomic writes to gossip_store), but if they are,
    others surely are too.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 21, 2019
    Configuration menu
    Copy the full SHA
    adcb664 View commit details
    Browse the repository at this point in the history
  4. pytest: fix test_gossip_store_load_no_channel_update

    It wasn't invalid due to a missing channel_update, but in fact was a
    bad checksum due to a cut & paste bug.  Fix that, and assert it's not
    actually truncating.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 21, 2019
    Configuration menu
    Copy the full SHA
    9bf0467 View commit details
    Browse the repository at this point in the history
  5. gossipd: be more verbose and less assert()ive on bad node_announcement.

    We hit the timestamp assert on ElementsProject#2750; it shouldn't happen, but crashing
    doesn't leave much information.
    
    Reported-by: @m-schmook
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 21, 2019
    Configuration menu
    Copy the full SHA
    fc27250 View commit details
    Browse the repository at this point in the history
  6. gossipd: tighter correctness checks during gossip_store load.

    We shouldn't be loading old timestamps, either.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 21, 2019
    Configuration menu
    Copy the full SHA
    8ce3b86 View commit details
    Browse the repository at this point in the history
  7. gossipd: remove gossip entirely if we hit a problem on load.

    The crashes in ElementsProject#2750 are mostly caused by us trying to partially truncate
    the store.  The simplest fix for release is to discard the whole thing if
    we detect a problem.
    
    This is a workaround: it'd be far nicer to try to recover.
    
    Fixes: ElementsProject#2750
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 21, 2019
    Configuration menu
    Copy the full SHA
    8928f0b View commit details
    Browse the repository at this point in the history
  8. gossip_store: make copy of corrupt gossip_store on failure.

    This should help debugging vastly.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 21, 2019
    Configuration menu
    Copy the full SHA
    c15d9ed View commit details
    Browse the repository at this point in the history

Commits on Jun 22, 2019

  1. gossipd: only do (automatic) store compaction at startup.

    Rewriting the gossip_store is much more trivial when we don't have
    any pointers into it, so add some simple offline compaction code
    and disable the automatic compaction code.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and niftynei committed Jun 22, 2019
    Configuration menu
    Copy the full SHA
    c303d7d View commit details
    Browse the repository at this point in the history
  2. bugfix: Proper json for listtransactions' response

    [ Fixup for uninitialized var -- RR ]
    jtimon authored and rustyrussell committed Jun 22, 2019
    Configuration menu
    Copy the full SHA
    86b5b84 View commit details
    Browse the repository at this point in the history
  3. pylightning: Add new listtransactions command

    [ FIXUP: Uninitialized var response used as context, changed to cmd --RR ]
    jtimon authored and rustyrussell committed Jun 22, 2019
    Configuration menu
    Copy the full SHA
    83f2ccd View commit details
    Browse the repository at this point in the history

Commits on Jun 23, 2019

  1. json-rpc: Disable listtransactions for the 0.7.1 release

    Due to API instability we are disabling the RPC method for this release, but
    will re-enable it after the release again.
    
    Signed-off-by: Christian Decker <@cdecker>
    cdecker authored and rustyrussell committed Jun 23, 2019
    Configuration menu
    Copy the full SHA
    ee587af View commit details
    Browse the repository at this point in the history
  2. CHANGELOG.md: v0.7.1rc3

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 23, 2019
    Configuration menu
    Copy the full SHA
    c1328b3 View commit details
    Browse the repository at this point in the history

Commits on Jun 27, 2019

  1. lightningd: don't crash on old zero-output commitment_txs.

    We used to produce these, but they're invalid.  When we switched to
    libwally it (correctly) refuses to get a txid for them.
    
    Fixes: ElementsProject#2772
    Fixes: ElementsProject#2759
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 27, 2019
    Configuration menu
    Copy the full SHA
    960bfb8 View commit details
    Browse the repository at this point in the history
  2. channeld/lightningd/hsmd: strengthen our checks against 0-output txs.

    If we ever do this, we'd end up with an unspendable commitment tx anyway.
    It might be able to happen if we have htlcs added from the non-fee-paying
    party while the fees are increased, though.  But better to close the
    channel and get a report about it if that happens.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 27, 2019
    Configuration menu
    Copy the full SHA
    a450962 View commit details
    Browse the repository at this point in the history
  3. 0.7.1rc4

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 27, 2019
    Configuration menu
    Copy the full SHA
    707ce4c View commit details
    Browse the repository at this point in the history

Commits on Jun 28, 2019

  1. lightningd: fix occasional missing txid detection.

    I was working on rewriting our (somewhat chaotic) tx watching code
    for 0.7.2, when I found this bug: we don't always notice the funding
    tx in corner cases where more than one block is detected at
    once.
    
    This is just the one commit needed to fix the problem: it has some
    unnecessary changes, but I'd prefer not to diverge too far from my
    cleanup-txwatch branch.
    
    Fixes: ElementsProject#2352
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 28, 2019
    Configuration menu
    Copy the full SHA
    f1bea55 View commit details
    Browse the repository at this point in the history
  2. v0.7.1rc5.

    This has definitely reinforced that we need shorter release cycles!
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 28, 2019
    Configuration menu
    Copy the full SHA
    fc6de94 View commit details
    Browse the repository at this point in the history

Commits on Jun 29, 2019

  1. v0.7.1

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jun 29, 2019
    Configuration menu
    Copy the full SHA
    43d5492 View commit details
    Browse the repository at this point in the history

Commits on Jul 13, 2019

  1. Merge branch 'master' of https://github.com/dflatemaster/lightning

    # Conflicts:
    #	.gitignore
    #	bitcoin/base58.c
    #	bitcoin/base58.h
    #	bitcoin/chainparams.c
    #	channeld/test/run-full_channel.c
    #	common/test/run-bolt11.c
    #	contrib/init/lightningd.service
    #	contrib/pylightning/lightning/lightning.py
    #	doc/lightningd-config.5.txt
    #	external/libwally-core
    #	lightningd/chaintopology.c
    #	lightningd/jsonrpc.c
    #	tests/test_connection.py
    #	tests/test_misc.py
    #	wallet/walletrpc.c
    
    Signed-off-by: dflate <dflate@noreply.com>
    dflate committed Jul 13, 2019
    Configuration menu
    Copy the full SHA
    32e0c2c View commit details
    Browse the repository at this point in the history
  2. grs to wally-grs

    signed-off-by: dflate <dflate@noreply.com>
    dflate committed Jul 13, 2019
    Configuration menu
    Copy the full SHA
    9ef7580 View commit details
    Browse the repository at this point in the history
  3. Signed-off-by: dflate <dflate@noreply.com>

    dflate committed Jul 13, 2019
    Configuration menu
    Copy the full SHA
    904cce2 View commit details
    Browse the repository at this point in the history
  4. grs patch wally

    change double to single sha256 for tx
    
    Signed-off-by: dflate <dflate@noreply.com>
    dflate committed Jul 13, 2019
    Configuration menu
    Copy the full SHA
    56f4146 View commit details
    Browse the repository at this point in the history
  5. legacy grs-address check

    Signed-off-by: dflate <dflate@noreply.com>
    dflate committed Jul 13, 2019
    Configuration menu
    Copy the full SHA
    412f9e8 View commit details
    Browse the repository at this point in the history
  6. allow static tor address to bind to unannounced hidden local address

    i.e.if service is setup in torrc
    
    Signed-off-by: dflate <dflate@noreply.com>
    dflate committed Jul 13, 2019
    Configuration menu
    Copy the full SHA
    bc06214 View commit details
    Browse the repository at this point in the history

Commits on Jul 14, 2019

  1. fixup after merge to grs values for base58 addr prefix

    Signed-off-by: dflate <dflate@noreply.com>
    dflate committed Jul 14, 2019
    Configuration menu
    Copy the full SHA
    b8a9973 View commit details
    Browse the repository at this point in the history
  2. use in base58 to grs prefix 28

    Signed-off-by: dflate <dflate@noreply.com>
    dflate committed Jul 14, 2019
    Configuration menu
    Copy the full SHA
    18978eb View commit details
    Browse the repository at this point in the history
  3. use chainparams for base58

    Signed-off-by: dflate <dflate@noreply.com>
    dflate committed Jul 14, 2019
    Configuration menu
    Copy the full SHA
    cf9aec8 View commit details
    Browse the repository at this point in the history

Commits on Jul 16, 2019

  1. eclair <--> grs-c-lightning compat-mode

    use Groestl hash only for blocks and tx
    
    Signed-off-by: dflate <dflate@noreply.com>
    dflate committed Jul 16, 2019
    Configuration menu
    Copy the full SHA
    caa65d6 View commit details
    Browse the repository at this point in the history

Commits on Jul 17, 2019

  1. use pure groestlhash for double_sha256

    Signed-off-by: dflate <dflate@noreply.com>
    dflate committed Jul 17, 2019
    Configuration menu
    Copy the full SHA
    222e84f View commit details
    Browse the repository at this point in the history