Browse Source

masterd: Peer has to know which direction an eventual channel is

Signed-off-by: Christian Decker <decker.christian@gmail.com>
ppa-0.6.1
Christian Decker 7 years ago
committed by Rusty Russell
parent
commit
d14969ce77
  1. 2
      lightningd/peer_control.c
  2. 3
      lightningd/peer_control.h

2
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,

3
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)

Loading…
Cancel
Save