Skip to content

Commit a6f1031

Browse files
invoice: decode rgb invoice
Signed-off-by: Vincenzo Palazzo <[email protected]>
1 parent 3d98db0 commit a6f1031

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

common/bolt11.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ struct bolt11 {
8080
u8 *metadata;
8181

8282
struct list_head extra_fields;
83+
84+
// FIXME(vincenzopalazzo): adds rgb information
85+
//
86+
// 1. `rgb_amt`
87+
// 2. `rgb_contract_id`
8388
};
8489

8590
/* Decodes and checks signature; returns NULL on error; description is

common/bolt11_json.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,9 @@ void json_add_bolt11(struct json_stream *response,
121121

122122
json_add_string(response, "signature",
123123
fmt_secp256k1_ecdsa_signature(tmpctx, &b11->sig));
124+
125+
// FIXME(vincenzopalazzo): adding tag RGB information
126+
//
127+
// 1. Adds `rgb_amt`
128+
// 2. Adds `rgb_contract_id`
124129
}

plugins/offers.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,6 +1194,9 @@ static struct command_result *json_decode(struct command *cmd,
11941194

11951195
response = jsonrpc_stream_success(cmd);
11961196
json_add_string(response, "type", decodable->type);
1197+
// FIXME(vincenzopalazzo): To decode an RGB invoice we should
1198+
// make sure that the RGB is only supported in the bolt11,
1199+
// otherwise throws an error.
11971200
if (decodable->offer)
11981201
json_add_offer(response, decodable->offer);
11991202
if (decodable->invreq)

0 commit comments

Comments
 (0)