Browse Source

common/sphinx: use bigsize_get not varint_get.

These are not the same if it's more than one byte.  Testing would have
caught this, I assume.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
pull/2938/head
Rusty Russell 5 years ago
parent
commit
e23f183468
  1. 2
      common/sphinx.c

2
common/sphinx.c

@ -486,7 +486,7 @@ static void sphinx_parse_payload(struct route_step *step, const u8 *src)
hop_size = FRAME_SIZE;
step->type = SPHINX_V0_PAYLOAD;
} else {
vsize = varint_get(src, 3, &raw_size);
vsize = bigsize_get(src, 3, &raw_size);
hop_size = raw_size + vsize + HMAC_SIZE;
step->type = SPHINX_TLV_PAYLOAD;
}

Loading…
Cancel
Save