wallet: Retrieve transaction annotations when listing transactions

This triple join should be efficient to read, and to process. We have a
one-to-many (tx-to-annotations), followed by a
one-to-one (annotation-to-channel) join, so we are limited to annotations x
transactions results.
This commit is contained in:
Christian Decker
2019-10-02 19:36:28 +02:00
committed by neil saitug
parent ddae604f3d
commit d981b58234
3 changed files with 93 additions and 21 deletions

View File

@@ -936,12 +936,6 @@ static struct command_result *json_listtransactions(struct command *cmd,
json_add_hex_talarr(response, "rawtx", txs[i].rawtx);
json_add_u64(response, "blockheight", txs[i].blockheight);
json_add_num(response, "txindex", txs[i].txindex);
json_add_txtypes(response, "type", txs[i].type);
if (txs[i].channel_id != 0) {
json_add_num(response, "channel_id", txs[i].channel_id);
} else {
json_add_null(response, "channel_id");
}
json_object_end(response);
}
json_array_end(response);