wire: Correct the short channel id serialization to use 3+3+2

Fixes the `short_channel_id` being serialized as 4 bytes block height,
3 bytes transaction index and 1 byte output number, to use 3+3+2 as
the spec says.

The reordering in the unit test structs is mainly to be able to still
use `eq_upto` for tests.
This commit is contained in:
Christian Decker
2017-05-19 14:28:39 +02:00
committed by Rusty Russell
parent b8ba8f003c
commit 05e951d748
8 changed files with 39 additions and 17 deletions

View File

@@ -158,7 +158,7 @@ struct node_connection *get_connection_by_scid(const struct routing_state *rstat
num_conn = tal_count(n->out);
for (i = 0; i < num_conn; i++){
c = n->out[i];
if (structeq(&c->short_channel_id, schanid) &&
if (short_channel_id_eq(&c->short_channel_id, schanid) &&
(c->flags&0x1) == direction)
return c;
}