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

Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
Christian Decker 2018-01-23 22:11:44 +01:00 committed by Rusty Russell
parent 4f4b0e9bba
commit d14969ce77
2 changed files with 5 additions and 0 deletions

View File

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

View File

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