Skip to content

Commit

Permalink
fixup! sphinx: Cleanup sphinx onion construction, remove realm
Browse files Browse the repository at this point in the history
  • Loading branch information
cdecker committed Jul 18, 2019
1 parent bd027ab commit 8964f65
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions devtools/onion.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,8 @@ static void runtest(const char *filename)
pubkeytok = json_get_member(buffer, hop, "pubkey");
payload = json_tok_bin_from_hex(ctx, buffer, payloadtok);
json_to_pubkey(buffer, pubkeytok, &pubkey);
if (json_tok_streq(buffer, typetok, "legacy")) {
if (!typetok || json_tok_streq(buffer, typetok, "legacy")) {
type = SPHINX_V0_PAYLOAD;
printf("legacy\n");
} else {
type = SPHINX_RAW_PAYLOAD;
}
Expand All @@ -265,22 +264,6 @@ static void runtest(const char *filename)
}
printf("Generated onion: %s\n", tal_hex(ctx, serialized));

hopstok = json_get_member(buffer, gentok, "hops");
json_for_each_arr(i, hop, hopstok) {
payloadtok = json_get_member(buffer, hop, "payload");
typetok = json_get_member(buffer, hop, "type");
pubkeytok = json_get_member(buffer, hop, "pubkey");
payload = json_tok_bin_from_hex(ctx, buffer, payloadtok);
json_to_pubkey(buffer, pubkeytok, &pubkey);
if (json_tok_streq(buffer, typetok, "legacy")) {
type = SPHINX_V0_PAYLOAD;
printf("legacy\n");
} else {
type = SPHINX_RAW_PAYLOAD;
}
sphinx_add_raw_hop(path, &pubkey, type, payload);
}

decodetok = json_get_member(buffer, toks, "decode");

json_for_each_arr(i, hop, decodetok) {
Expand Down

0 comments on commit 8964f65

Please sign in to comment.