Skip to content

Commit fa9b984

Browse files
committed
descriptor: store all features in the node flags as well as the context
1 parent 2656858 commit fa9b984

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/descriptor.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2053,8 +2053,9 @@ static int analyze_pubkey_hex(ms_ctx *ctx, const char *str, size_t str_len,
20532053
node->flags |= WALLY_MS_IS_X_ONLY;
20542054
ctx->features |= WALLY_MS_IS_X_ONLY;
20552055
}
2056-
node->kind = KIND_PUBLIC_KEY;
20572056
ctx->features |= WALLY_MS_IS_RAW;
2057+
node->kind = KIND_PUBLIC_KEY;
2058+
node->flags |= WALLY_MS_IS_RAW;
20582059
*is_hex = true;
20592060
return ctx_add_key_node(ctx, node);
20602061
}
@@ -2115,6 +2116,7 @@ static int analyze_miniscript_key(ms_ctx *ctx, uint32_t flags,
21152116
node->data_len = EC_PRIVATE_KEY_LEN;
21162117
node->kind = KIND_PRIVATE_KEY;
21172118
ctx->features |= (WALLY_MS_IS_PRIVATE | WALLY_MS_IS_RAW);
2119+
node->flags |= (WALLY_MS_IS_PRIVATE | WALLY_MS_IS_RAW);
21182120
ret = ctx_add_key_node(ctx, node);
21192121
}
21202122
wally_clear(privkey, sizeof(privkey));
@@ -2166,6 +2168,7 @@ static int analyze_miniscript_key(ms_ctx *ctx, uint32_t flags,
21662168
if (extkey.priv_key[0] == BIP32_FLAG_KEY_PRIVATE) {
21672169
node->kind = KIND_BIP32_PRIVATE_KEY;
21682170
ctx->features |= WALLY_MS_IS_PRIVATE;
2171+
node->flags |= WALLY_MS_IS_PRIVATE;
21692172
} else
21702173
node->kind = KIND_BIP32_PUBLIC_KEY;
21712174

0 commit comments

Comments
 (0)