diff --git a/lightningd/peer_control.c b/lightningd/peer_control.c index 7918c85bd..172998613 100644 --- a/lightningd/peer_control.c +++ b/lightningd/peer_control.c @@ -2095,6 +2095,8 @@ static bool peer_start_channeld(struct peer *peer, if (peer->ld->config.ignore_fee_limits) log_debug(peer->log, "Ignoring fee limits!"); + peer->direction = pubkey_cmp(&peer->ld->id, &peer->id) > 0; + initmsg = towire_channel_init(tmpctx, &get_chainparams(peer->ld) ->genesis_blockhash, diff --git a/lightningd/peer_control.h b/lightningd/peer_control.h index 1b8793566..51f5003ed 100644 --- a/lightningd/peer_control.h +++ b/lightningd/peer_control.h @@ -100,6 +100,9 @@ struct peer { struct changed_htlc *last_sent_commit; struct wallet_channel *channel; + + /* If we open a channel our direction will be this */ + u8 direction; }; static inline bool peer_can_add_htlc(const struct peer *peer)