diff --git a/db/db_postgres.c b/db/db_postgres.c index 7f6f143bc750..19ff4d52ccc8 100644 --- a/db/db_postgres.c +++ b/db/db_postgres.c @@ -277,19 +277,11 @@ static bool db_postgres_rename_column(struct db *db, const char *tablename, const char *from, const char *to) { - PGresult *res; char *cmd; cmd = tal_fmt(db, "ALTER TABLE %s RENAME %s TO %s;", tablename, from, to); - res = PQexec(db->conn, cmd); - if (PQresultStatus(res) != PGRES_COMMAND_OK) { - db->error = tal_fmt(db, "Rename '%s' failed: %s", - cmd, PQerrorMessage(db->conn)); - PQclear(res); - return false; - } - PQclear(res); + db_exec_prepared_v2(take(db_prepare_untranslated(db, cmd))); return true; } @@ -297,7 +289,6 @@ static bool db_postgres_delete_columns(struct db *db, const char *tablename, const char **colnames, size_t num_cols) { - PGresult *res; char *cmd; cmd = tal_fmt(db, "ALTER TABLE %s ", tablename); @@ -307,14 +298,8 @@ static bool db_postgres_delete_columns(struct db *db, tal_append_fmt(&cmd, "DROP %s", colnames[i]); } tal_append_fmt(&cmd, ";"); - res = PQexec(db->conn, cmd); - if (PQresultStatus(res) != PGRES_COMMAND_OK) { - db->error = tal_fmt(db, "Delete '%s' failed: %s", - cmd, PQerrorMessage(db->conn)); - PQclear(res); - return false; - } - PQclear(res); + + db_exec_prepared_v2(take(db_prepare_untranslated(db, cmd))); return true; } diff --git a/db/db_sqlite3.c b/db/db_sqlite3.c index 90f0a4aa28e3..26cbe2e6af07 100644 --- a/db/db_sqlite3.c +++ b/db/db_sqlite3.c @@ -1,7 +1,9 @@ #include "config.h" #include #include +#include #include +#include #include #if HAVE_SQLITE3 @@ -446,6 +448,7 @@ static bool colname_to_delete(const char **colnames, return false; } +/* Returns NULL if this doesn't look like a column definition */ static const char *find_column_name(const tal_t *ctx, const char *sqlpart, size_t *after) @@ -455,12 +458,13 @@ static const char *find_column_name(const tal_t *ctx, while (isspace(sqlpart[start])) start++; *after = strspn(sqlpart + start, "abcdefghijklmnopqrstuvwxyz_0123456789") + start; - if (*after == start) + if (*after == start || !cisspace(sqlpart[*after])) return NULL; return tal_strndup(ctx, sqlpart + start, *after - start); } -/* Move table out the way, return columns */ +/* Move table out the way, return columns. + * Note: with db_hook, frees tmpctx! */ static char **prepare_table_manip(const tal_t *ctx, struct db *db, const char *tablename) { @@ -487,39 +491,35 @@ static char **prepare_table_manip(const tal_t *ctx, sql = tal_strdup(tmpctx, (const char *)sqlite3_column_text(stmt, 0)); sqlite3_finalize(stmt); + /* We MUST use generic routines to write to db, since they + * mirror changes to the db hook! */ bracket = strchr(sql, '('); - if (!strstarts(sql, "CREATE TABLE") || !bracket) { - db->error = tal_fmt(db, "strange schema for %s: %s", - tablename, sql); - return NULL; - } + if (!strstarts(sql, "CREATE TABLE") || !bracket) + db_fatal("Bad sql from prepare_table_manip %s: %s", + tablename, sql); /* Split after ( by commas: any lower case is assumed to be a field */ parts = tal_strsplit(ctx, bracket + 1, ",", STR_EMPTY_OK); + /* Now, we actually need to turn OFF transactions for a moment, as + * this pragma only has an effect outside a tx! */ + db_commit_transaction(db); + + /* But core insists we're "in a transaction" for all ops, so fake it */ + db->in_transaction = "Not really"; /* Turn off foreign keys first. */ - sqlite3_prepare_v2(wrapper->conn, "PRAGMA foreign_keys = OFF;", -1, &stmt, NULL); - if (sqlite3_step(stmt) != SQLITE_DONE) - goto sqlite_stmt_err; - sqlite3_finalize(stmt); + db_prepare_for_changes(db); + db_exec_prepared_v2(take(db_prepare_untranslated(db, + "PRAGMA foreign_keys = OFF;"))); + db_report_changes(db, NULL, 0); + db->in_transaction = NULL; + db_begin_transaction(db); cmd = tal_fmt(tmpctx, "ALTER TABLE %s RENAME TO temp_%s;", tablename, tablename); - sqlite3_prepare_v2(wrapper->conn, cmd, -1, &stmt, NULL); - if (sqlite3_step(stmt) != SQLITE_DONE) - goto sqlite_stmt_err; - sqlite3_finalize(stmt); - - /* Make sure we do the same to backup! */ - replicate_statement(wrapper, "PRAGMA foreign_keys = OFF;"); - replicate_statement(wrapper, cmd); + db_exec_prepared_v2(take(db_prepare_untranslated(db, cmd))); return parts; - -sqlite_stmt_err: - db->error = tal_fmt(db, "%s", sqlite3_errmsg(wrapper->conn)); - sqlite3_finalize(stmt); - return tal_free(parts); } static bool complete_table_manip(struct db *db, @@ -527,9 +527,7 @@ static bool complete_table_manip(struct db *db, const char **coldefs, const char **oldcolnames) { - sqlite3_stmt *stmt; char *create_cmd, *insert_cmd, *drop_cmd; - struct db_sqlite3 *wrapper = (struct db_sqlite3 *)db->conn; /* Create table */ create_cmd = tal_fmt(tmpctx, "CREATE TABLE %s (", tablename); @@ -540,13 +538,7 @@ static bool complete_table_manip(struct db *db, } tal_append_fmt(&create_cmd, ";"); - sqlite3_prepare_v2(wrapper->conn, create_cmd, -1, &stmt, NULL); - if (sqlite3_step(stmt) != SQLITE_DONE) - goto sqlite_stmt_err; - sqlite3_finalize(stmt); - - /* Make sure we do the same to backup! */ - replicate_statement(wrapper, create_cmd); + db_exec_prepared_v2(take(db_prepare_untranslated(db, create_cmd))); /* Populate table from old one */ insert_cmd = tal_fmt(tmpctx, "INSERT INTO %s SELECT ", tablename); @@ -557,33 +549,24 @@ static bool complete_table_manip(struct db *db, } tal_append_fmt(&insert_cmd, " FROM temp_%s;", tablename); - sqlite3_prepare_v2(wrapper->conn, insert_cmd, -1, &stmt, NULL); - if (sqlite3_step(stmt) != SQLITE_DONE) - goto sqlite_stmt_err; - sqlite3_finalize(stmt); - replicate_statement(wrapper, insert_cmd); + db_exec_prepared_v2(take(db_prepare_untranslated(db, insert_cmd))); /* Cleanup temp table */ drop_cmd = tal_fmt(tmpctx, "DROP TABLE temp_%s;", tablename); - sqlite3_prepare_v2(wrapper->conn, drop_cmd, -1, &stmt, NULL); - if (sqlite3_step(stmt) != SQLITE_DONE) - goto sqlite_stmt_err; - sqlite3_finalize(stmt); - replicate_statement(wrapper, drop_cmd); + db_exec_prepared_v2(take(db_prepare_untranslated(db, drop_cmd))); + db_commit_transaction(db); /* Allow links between them (esp. cascade deletes!) */ - sqlite3_prepare_v2(wrapper->conn, "PRAGMA foreign_keys = ON;", -1, &stmt, NULL); - if (sqlite3_step(stmt) != SQLITE_DONE) - goto sqlite_stmt_err; - sqlite3_finalize(stmt); - replicate_statement(wrapper, "PRAGMA foreign_keys = ON;"); - + db->in_transaction = "Not really"; + db_prepare_for_changes(db); + db_exec_prepared_v2(take(db_prepare_untranslated(db, + "PRAGMA foreign_keys = ON;"))); + db_report_changes(db, NULL, 0); + db->in_transaction = NULL; + + /* migrations are performed inside transactions, so start one. */ + db_begin_transaction(db); return true; - -sqlite_stmt_err: - db->error = tal_fmt(db, "%s", sqlite3_errmsg(wrapper->conn)); - sqlite3_finalize(stmt); - return false; } static bool db_sqlite3_rename_column(struct db *db, @@ -594,10 +577,11 @@ static bool db_sqlite3_rename_column(struct db *db, const char **coldefs, **oldcolnames; bool colname_found = false; - parts = prepare_table_manip(tmpctx, db, tablename); + parts = prepare_table_manip(NULL, db, tablename); if (!parts) return false; + tal_steal(tmpctx, parts); coldefs = tal_arr(tmpctx, const char *, 0); oldcolnames = tal_arr(tmpctx, const char *, 0); @@ -642,10 +626,11 @@ static bool db_sqlite3_delete_columns(struct db *db, const char **coldefs, **oldcolnames; size_t colnames_found = 0; - parts = prepare_table_manip(tmpctx, db, tablename); + parts = prepare_table_manip(NULL, db, tablename); if (!parts) return false; + tal_steal(tmpctx, parts); coldefs = tal_arr(tmpctx, const char *, 0); oldcolnames = tal_arr(tmpctx, const char *, 0); diff --git a/db/exec.c b/db/exec.c index 13341c1e7d64..96ef3855610e 100644 --- a/db/exec.c +++ b/db/exec.c @@ -45,8 +45,11 @@ u32 db_data_version_get(struct db *db) u32 version; stmt = db_prepare_v2(db, SQL("SELECT intval FROM vars WHERE name = 'data_version'")); db_query_prepared(stmt); - db_step(stmt); - version = db_col_int(stmt, "intval"); + /* This fails on uninitialized db, so "0" */ + if (db_step(stmt)) + version = db_col_int(stmt, "intval"); + else + version = 0; tal_free(stmt); return version; } diff --git a/db/utils.c b/db/utils.c index 96f442fbbcec..106aae834905 100644 --- a/db/utils.c +++ b/db/utils.c @@ -61,11 +61,38 @@ static void db_stmt_free(struct db_stmt *stmt) } +static struct db_stmt *db_prepare_core(struct db *db, + const char *location, + const struct db_query *db_query) +{ + struct db_stmt *stmt = tal(db, struct db_stmt); + size_t num_slots = db_query->placeholders; + + /* Allocate the slots for placeholders/bindings, zeroed next since + * that sets the type to DB_BINDING_UNINITIALIZED for later checks. */ + stmt->bindings = tal_arrz(stmt, struct db_binding, num_slots); + stmt->location = location; + stmt->error = NULL; + stmt->db = db; + stmt->query = db_query; + stmt->executed = false; + stmt->inner_stmt = NULL; + + tal_add_destructor(stmt, db_stmt_free); + + list_add(&db->pending_statements, &stmt->list); + +#if DEVELOPER + stmt->cols_used = NULL; +#endif /* DEVELOPER */ + + return stmt; +} + struct db_stmt *db_prepare_v2_(const char *location, struct db *db, const char *query_id) { - struct db_stmt *stmt = tal(db, struct db_stmt); - size_t num_slots, pos; + size_t pos; /* Normalize query_id paths, because unit tests are compiled with this * prefix. */ @@ -81,40 +108,33 @@ struct db_stmt *db_prepare_v2_(const char *location, struct db *db, for (;;) { if (!db->queries->query_table[pos].name) db_fatal("Could not resolve query %s", query_id); - if (streq(query_id, db->queries->query_table[pos].name)) { - stmt->query = &db->queries->query_table[pos]; + if (streq(query_id, db->queries->query_table[pos].name)) break; - } pos = (pos + 1) % db->queries->query_table_size; } - num_slots = stmt->query->placeholders; - /* Allocate the slots for placeholders/bindings, zeroed next since - * that sets the type to DB_BINDING_UNINITIALIZED for later checks. */ - stmt->bindings = tal_arr(stmt, struct db_binding, num_slots); - for (size_t i=0; ibindings[i].type = DB_BINDING_UNINITIALIZED; - - stmt->location = location; - stmt->error = NULL; - stmt->db = db; - stmt->executed = false; - stmt->inner_stmt = NULL; + return db_prepare_core(db, location, &db->queries->query_table[pos]); +} - tal_add_destructor(stmt, db_stmt_free); +/* Provides replication and hook interface for raw SQL too */ +struct db_stmt *db_prepare_untranslated(struct db *db, const char *query) +{ + struct db_query *db_query = tal(NULL, struct db_query); + struct db_stmt *stmt; - list_add(&db->pending_statements, &stmt->list); + db_query->name = db_query->query = query; + db_query->placeholders = strcount(query, "?"); + db_query->readonly = false; -#if DEVELOPER - stmt->cols_used = NULL; -#endif /* DEVELOPER */ + /* Use raw accessors! */ + db_query->colnames = NULL; + db_query->num_colnames = 0; + stmt = db_prepare_core(db, "db_prepare_untranslated", db_query); + tal_steal(stmt, db_query); return stmt; } -#define db_prepare_v2(db,query) \ - db_prepare_v2_(__FILE__ ":" stringify(__LINE__), db, query) - bool db_query_prepared(struct db_stmt *stmt) { /* Make sure we don't accidentally execute a modifying query using a diff --git a/db/utils.h b/db/utils.h index 308a302f9091..e0c1f97f337d 100644 --- a/db/utils.h +++ b/db/utils.h @@ -97,4 +97,12 @@ void db_assert_no_outstanding_statements(struct db *db); */ const char **db_changes(struct db *db); +/** + * Accessor for internal use. + * + * Like db_prepare_v2() but creates temporary noop translation, and + * assumes not a read-only op. Use this inside db-specific backends + * to re-use the normal db hook and replication logic. + */ +struct db_stmt *db_prepare_untranslated(struct db *db, const char *query); #endif /* LIGHTNING_DB_UTILS_H */ diff --git a/doc/lightning-addgossip.7.md b/doc/lightning-addgossip.7.md index 97bcc008f150..72c662975342 100644 --- a/doc/lightning-addgossip.7.md +++ b/doc/lightning-addgossip.7.md @@ -42,4 +42,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:4d9f888d10faca2bf94d1b52510cf21fbeebae4efda0946f03d04b0ef4bc88a2) +[comment]: # ( SHA256STAMP:326e5801f65998e13e909d8b682e9fbc9824f3a43aa7da1d76b871882e52f293) diff --git a/doc/lightning-autocleaninvoice.7.md b/doc/lightning-autocleaninvoice.7.md index f3d2dfe33878..1aa59ef1cb4b 100644 --- a/doc/lightning-autocleaninvoice.7.md +++ b/doc/lightning-autocleaninvoice.7.md @@ -52,4 +52,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:06bb1ef610c0f82d3d370f468575f2d6e837a11473acd1267baab829aa505052) +[comment]: # ( SHA256STAMP:994e8f17bf35fc704f13206bf4c6909b525f9edcb1c8c4508345c720b007d34c) diff --git a/doc/lightning-bkpr-channelsapy.7.md b/doc/lightning-bkpr-channelsapy.7.md index 4a4b8a10f8ae..80554c9d035e 100644 --- a/doc/lightning-bkpr-channelsapy.7.md +++ b/doc/lightning-bkpr-channelsapy.7.md @@ -65,4 +65,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:296069892023c371e26305e8ab54d04a50aefeeff37a8a465d07893a8c39e61c) +[comment]: # ( SHA256STAMP:8ec833f8261ab8b559f0d645d6da45322b388905413ef262d95f5039d533fdc8) diff --git a/doc/lightning-bkpr-dumpincomecsv.7.md b/doc/lightning-bkpr-dumpincomecsv.7.md index 20980fd2627e..17b3ae4cb670 100644 --- a/doc/lightning-bkpr-dumpincomecsv.7.md +++ b/doc/lightning-bkpr-dumpincomecsv.7.md @@ -57,4 +57,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:4d9326acde55e8124ea61a7e2430f035d3a4957995a76ddef61ecb2a3debd042) +[comment]: # ( SHA256STAMP:1375c000d025b6cb72daa3b2ea64ec3212ae1aa5552c0d87918fd869d2fc5a0b) diff --git a/doc/lightning-bkpr-inspect.7.md b/doc/lightning-bkpr-inspect.7.md index faa45103c688..0fd01cf2b642 100644 --- a/doc/lightning-bkpr-inspect.7.md +++ b/doc/lightning-bkpr-inspect.7.md @@ -52,4 +52,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:022a11cd4bdaec7b1b39e30faaf5489de1db08684a3952b3a3152343e91c8c4c) +[comment]: # ( SHA256STAMP:ea50ea813e46669b522ebd466619ac6f7a4be5ae38b4f976a7db70a3c01b7fae) diff --git a/doc/lightning-bkpr-listaccountevents.7.md b/doc/lightning-bkpr-listaccountevents.7.md index aede7dccd875..e8c3f4030d17 100644 --- a/doc/lightning-bkpr-listaccountevents.7.md +++ b/doc/lightning-bkpr-listaccountevents.7.md @@ -71,4 +71,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:3b120f28969d50351823707c11f77a0264031b1ddec07794ac117b0e8e2d7a75) +[comment]: # ( SHA256STAMP:1ac0919bf29ebc37a92283d15a9ffa06f0f46be5fb55920b335d0c43e02a6ee4) diff --git a/doc/lightning-bkpr-listbalances.7.md b/doc/lightning-bkpr-listbalances.7.md index a98b3780c21a..21cad1db129e 100644 --- a/doc/lightning-bkpr-listbalances.7.md +++ b/doc/lightning-bkpr-listbalances.7.md @@ -53,4 +53,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:ae354f9ee2c0f3805923c7c1fbbf490d43c838449fe25758a6884c2f1686d20e) +[comment]: # ( SHA256STAMP:2801e5f237043c6f85d35e2f4a5f69aab5d1cb6a9fcbea9ead1da2daa93265c8) diff --git a/doc/lightning-bkpr-listincome.7.md b/doc/lightning-bkpr-listincome.7.md index d18a784ebf4b..77378193f8d7 100644 --- a/doc/lightning-bkpr-listincome.7.md +++ b/doc/lightning-bkpr-listincome.7.md @@ -57,4 +57,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:23bcaf41a3451f716cbeedc992c84b88a823d3aa219fd848e3c6c47ae9bbca55) +[comment]: # ( SHA256STAMP:24a4784f87f26283e8849e525d51b376d3e69ae20c0941cfd745a7d07af8032a) diff --git a/doc/lightning-check.7.md b/doc/lightning-check.7.md index d4fa3f1675a2..c859c61cbd67 100644 --- a/doc/lightning-check.7.md +++ b/doc/lightning-check.7.md @@ -41,4 +41,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:bd1993b3b95a6c1a9e21873632a829514eb4e9d00ad5084bb099798c8977de06) +[comment]: # ( SHA256STAMP:22c1ad9baf37cb8c7c4b587047d40ef23f0af3d821feaf1aab6d365d724b08fe) diff --git a/doc/lightning-checkmessage.7.md b/doc/lightning-checkmessage.7.md index 853cedec68b4..6d5c3af4a163 100644 --- a/doc/lightning-checkmessage.7.md +++ b/doc/lightning-checkmessage.7.md @@ -50,4 +50,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:9642945217c12b5ce41af5aef0547a42b6db5baa97ed88e6fde91345bb9a75f3) +[comment]: # ( SHA256STAMP:28b7c05443a785461a0134e3c2761a2e2d698cb71044f4d895d15ac7f2ee4316) diff --git a/doc/lightning-close.7.md b/doc/lightning-close.7.md index 349f6a73bb5b..5735410cb6ab 100644 --- a/doc/lightning-close.7.md +++ b/doc/lightning-close.7.md @@ -135,4 +135,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:89f0bd65ba94f07afaddac259a766d89e26a9acf646c0491c869d923db3091eb) +[comment]: # ( SHA256STAMP:6a438338ae697732f0100f9e1566b9b8d189778cdb05681305e060487d68663e) diff --git a/doc/lightning-commando-rune.7.md b/doc/lightning-commando-rune.7.md index 5708f883c060..3311b5fb4c53 100644 --- a/doc/lightning-commando-rune.7.md +++ b/doc/lightning-commando-rune.7.md @@ -219,4 +219,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:843aaf64ccded63baf949f0103dd0f18b9652f259f1d35e0fd67f45ee58c4e8f) +[comment]: # ( SHA256STAMP:08ded3c93fea629f414a96f12ac02de1000743a487ec8989ba1510a59861ccc1) diff --git a/doc/lightning-connect.7.md b/doc/lightning-connect.7.md index ae5b2fa5104c..ab6752fa303b 100644 --- a/doc/lightning-connect.7.md +++ b/doc/lightning-connect.7.md @@ -104,4 +104,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:27f1e0ad88e7908bbb450ffc1ba5c53855225adf126155cd62ddbd61a599c3ea) +[comment]: # ( SHA256STAMP:581c6243302c8fa5c9234de97e1f6af842bbfee544850c55281924721b46432f) diff --git a/doc/lightning-createinvoice.7.md b/doc/lightning-createinvoice.7.md index b8130b3f8d71..477f971fbafa 100644 --- a/doc/lightning-createinvoice.7.md +++ b/doc/lightning-createinvoice.7.md @@ -75,4 +75,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:1d552c5038b6062cd384b7f143ad139ab5275a2b44be09e6d51d7111109caca2) +[comment]: # ( SHA256STAMP:9fc2c7cb6e5980774a768dd9ddfe81e254c084554c159e6b07e92e703dc10595) diff --git a/doc/lightning-createonion.7.md b/doc/lightning-createonion.7.md index 9e6768eabee8..75aa660ccd7f 100644 --- a/doc/lightning-createonion.7.md +++ b/doc/lightning-createonion.7.md @@ -133,4 +133,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:719bc9feedb006638b14f3e6cd01aba479620f771868d8d954b34166224f1c8f) +[comment]: # ( SHA256STAMP:c8bd0abd35904cb009b95a7d345be4cc254cff2a427dcf04679a64a6e62dce1e) diff --git a/doc/lightning-datastore.7.md b/doc/lightning-datastore.7.md index 7313b59255d6..81c7409f790b 100644 --- a/doc/lightning-datastore.7.md +++ b/doc/lightning-datastore.7.md @@ -66,4 +66,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:f3f48ed1c5c5ccab128c4ce782b2f209896fe0ca6440e00799935dff9bef3f2e) +[comment]: # ( SHA256STAMP:cb5bccd7efd8438c61b909bda419e0300993b2b2267cb335c1f91d12bd402b3e) diff --git a/doc/lightning-decode.7.md b/doc/lightning-decode.7.md index 8a642cebbd45..53e23c4ea9fb 100644 --- a/doc/lightning-decode.7.md +++ b/doc/lightning-decode.7.md @@ -163,7 +163,7 @@ If **type** is "bolt11 invoice", and **valid** is *true*: - **routes** (array of arrays, optional): Route hints to the *payee*: - hops in the route: - **pubkey** (pubkey): the public key of the node - - **short\_channel\_id** (short_channel_id): a channel to the next peer + - **short\_channel\_id** (short\_channel\_id): a channel to the next peer - **fee\_base\_msat** (msat): the base fee for payments - **fee\_proportional\_millionths** (u32): the parts-per-million fee for payments - **cltv\_expiry\_delta** (u32): the CLTV delta across this hop @@ -211,4 +211,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:7497fbb2f802f2eef2b6c1a8005d31f4778af94c9d0384192a8ba1a4af936549) +[comment]: # ( SHA256STAMP:610b6f9d61e79b503ff81cc164f79ea90883c6d10f5e7b28555aefabfd6e17bb) diff --git a/doc/lightning-decodepay.7.md b/doc/lightning-decodepay.7.md index 25433d5a22c6..04faa4b14a7a 100644 --- a/doc/lightning-decodepay.7.md +++ b/doc/lightning-decodepay.7.md @@ -38,7 +38,7 @@ On success, an object is returned, containing: - **routes** (array of arrays, optional): Route hints to the *payee*: - hops in the route: - **pubkey** (pubkey): the public key of the node - - **short\_channel\_id** (short_channel_id): a channel to the next peer + - **short\_channel\_id** (short\_channel\_id): a channel to the next peer - **fee\_base\_msat** (msat): the base fee for payments - **fee\_proportional\_millionths** (u32): the parts-per-million fee for payments - **cltv\_expiry\_delta** (u32): the CLTV delta across this hop @@ -71,4 +71,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:b2a483f6fcb07e4bcddb088520049eee1d33447136e2634bf4207d54c21022e9) +[comment]: # ( SHA256STAMP:c98fd8cac46b5446ff2d01ede6b082f64a83d4b5745d06e410af3e1dd91be8e2) diff --git a/doc/lightning-deldatastore.7.md b/doc/lightning-deldatastore.7.md index e8cfc4513e31..c991b49a11e3 100644 --- a/doc/lightning-deldatastore.7.md +++ b/doc/lightning-deldatastore.7.md @@ -49,4 +49,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:3d70f21bc0945835995b820ab6d65b1ac6e88a9f13240f30acffd32315d41e70) +[comment]: # ( SHA256STAMP:262227d8b4aaee5cad954afa4335b29bceabd787f346d1e5a990614edac7f5e7) diff --git a/doc/lightning-delexpiredinvoice.7.md b/doc/lightning-delexpiredinvoice.7.md index 4f3fc644e7c7..c670f543ede0 100644 --- a/doc/lightning-delexpiredinvoice.7.md +++ b/doc/lightning-delexpiredinvoice.7.md @@ -38,4 +38,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:c2aef71377094e4c4ab09d3c18b3b8448e5fed1fcc2a6afd47ab218afb011b5e) +[comment]: # ( SHA256STAMP:01526643e128e75057c668cd5dd36e79f075ca847bc692629e1c773b6c940ae6) diff --git a/doc/lightning-delinvoice.7.md b/doc/lightning-delinvoice.7.md index 3bb95d720250..38408b516081 100644 --- a/doc/lightning-delinvoice.7.md +++ b/doc/lightning-delinvoice.7.md @@ -81,4 +81,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:a869dc2b48e763c47f3af1c27143d194db96948f19fbcec82df343bd3b6c4468) +[comment]: # ( SHA256STAMP:d754daa61ddb65009fced566338af35ffb23069593f4741e6d8f6f138f60bb4f) diff --git a/doc/lightning-delpay.7.md b/doc/lightning-delpay.7.md index a3bf29c3057d..47a1dd9af340 100644 --- a/doc/lightning-delpay.7.md +++ b/doc/lightning-delpay.7.md @@ -102,4 +102,4 @@ RESOURCES --------- Main web site: -[comment]: # ( SHA256STAMP:f687e5248b633be5e6e3bb515b7b006858a3f2499bb5955240b3e18dd80794a8) +[comment]: # ( SHA256STAMP:08dbf42e6d4bd63f9b6e7a45112b348c84d6192d3ff3087e5e02b4a4788e5605) diff --git a/doc/lightning-disableoffer.7.md b/doc/lightning-disableoffer.7.md index 842ec0d24704..2af2c73060b6 100644 --- a/doc/lightning-disableoffer.7.md +++ b/doc/lightning-disableoffer.7.md @@ -75,4 +75,4 @@ RESOURCES --------- Main web site: -[comment]: # ( SHA256STAMP:a2489ae6d986292861555d66a1fb0c8c39efe460db5e324ddbb27b9be1650296) +[comment]: # ( SHA256STAMP:27200ba49d493cbbb1ea84736ccfaeb05a92c69dab34f48cd3d5bbf46ffc2d64) diff --git a/doc/lightning-disconnect.7.md b/doc/lightning-disconnect.7.md index 2a7b4f67964d..68b5f5277277 100644 --- a/doc/lightning-disconnect.7.md +++ b/doc/lightning-disconnect.7.md @@ -59,4 +59,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:4d9f888d10faca2bf94d1b52510cf21fbeebae4efda0946f03d04b0ef4bc88a2) +[comment]: # ( SHA256STAMP:326e5801f65998e13e909d8b682e9fbc9824f3a43aa7da1d76b871882e52f293) diff --git a/doc/lightning-feerates.7.md b/doc/lightning-feerates.7.md index 0328e8fa49a1..ff3c6ee31bd0 100644 --- a/doc/lightning-feerates.7.md +++ b/doc/lightning-feerates.7.md @@ -121,4 +121,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:8b9053a3047bc47e9cb86d8ae059e9b955194d1761d07b33ed7b78c85f434c34) +[comment]: # ( SHA256STAMP:d448abe4c00efb8cb68edf6f8316f130ed45a26223b151ac0647bf5b69aec4fd) diff --git a/doc/lightning-fetchinvoice.7.md b/doc/lightning-fetchinvoice.7.md index dd870179034a..9f219f141ca9 100644 --- a/doc/lightning-fetchinvoice.7.md +++ b/doc/lightning-fetchinvoice.7.md @@ -89,4 +89,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:003592ea0876d08b2109a0daa5e10328e049013f8e44d3eccc5805885a16a375) +[comment]: # ( SHA256STAMP:18164ef676c71c8d3abde89d974b3c74bd7fdb43356a737f937b2fb060795a47) diff --git a/doc/lightning-fundchannel.7.md b/doc/lightning-fundchannel.7.md index babc38327986..3f9e80566769 100644 --- a/doc/lightning-fundchannel.7.md +++ b/doc/lightning-fundchannel.7.md @@ -115,4 +115,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:f1c2b762c111ecb6d569075377e1a79cd9fceb60863fc56aeddcdbcd51445812) +[comment]: # ( SHA256STAMP:bca36e910b93b86fc42c2d047e703e9760250757cbf09d8cacdf4e3fe1a1f605) diff --git a/doc/lightning-fundchannel_cancel.7.md b/doc/lightning-fundchannel_cancel.7.md index ab68df060ef8..2a2ce70e596e 100644 --- a/doc/lightning-fundchannel_cancel.7.md +++ b/doc/lightning-fundchannel_cancel.7.md @@ -60,4 +60,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:6e9501860847adfa98cf725e65297322428986f6345aeb04cd0ece150780ec66) +[comment]: # ( SHA256STAMP:a6b67ae1ecd3bfe5c41e17710342ce32e93675775653bfcffc5b7413c6a15726) diff --git a/doc/lightning-fundchannel_complete.7.md b/doc/lightning-fundchannel_complete.7.md index 248571b904f0..55d74f9716a8 100644 --- a/doc/lightning-fundchannel_complete.7.md +++ b/doc/lightning-fundchannel_complete.7.md @@ -62,4 +62,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:b0602c5c3ab5370199776b56656451538712b989e9bfc169934ddabeff56894c) +[comment]: # ( SHA256STAMP:6852cb54595920fa692b6c0a816b44efa7623a3fd12af90602a137f7de0fc57c) diff --git a/doc/lightning-fundchannel_start.7.md b/doc/lightning-fundchannel_start.7.md index c6239df49ac0..66c51000374e 100644 --- a/doc/lightning-fundchannel_start.7.md +++ b/doc/lightning-fundchannel_start.7.md @@ -85,4 +85,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:d76e01b4e00915ca84e6960c8718028bc220712a4c387711c01977c3ee80ddf4) +[comment]: # ( SHA256STAMP:b054bc55f69cc1f23f78f342974a8476eab84146bbcf57ab30095e8eba3ed849) diff --git a/doc/lightning-funderupdate.7.md b/doc/lightning-funderupdate.7.md index 4419642fefad..b02300ca4c52 100644 --- a/doc/lightning-funderupdate.7.md +++ b/doc/lightning-funderupdate.7.md @@ -147,4 +147,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:c5895e85860542fa6d71d4acf8b1e0d43acaf395331b357064150ee1d52ddcca) +[comment]: # ( SHA256STAMP:03b74bb9d03466181e3f643f718a07388e722e4a6ea1fbb30350e22a7fc491c3) diff --git a/doc/lightning-fundpsbt.7.md b/doc/lightning-fundpsbt.7.md index 3402dcce7f5e..827bbf6fffcf 100644 --- a/doc/lightning-fundpsbt.7.md +++ b/doc/lightning-fundpsbt.7.md @@ -115,4 +115,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:7503bff4054024adf29a560f8612e2c504fe1252c71c3a3bb08282808fb299a7) +[comment]: # ( SHA256STAMP:0f290582f49c6103258b7f781a9e7fa4075ec6c05335a459a91da0b6fd58c68d) diff --git a/doc/lightning-getinfo.7.md b/doc/lightning-getinfo.7.md index 0a546473dfcb..99cc81369b36 100644 --- a/doc/lightning-getinfo.7.md +++ b/doc/lightning-getinfo.7.md @@ -131,4 +131,4 @@ RESOURCES --------- Main web site: -[comment]: # ( SHA256STAMP:a517e840e673273a35128e8168d8f58f7795bf0bcfca00f25b859f6e171b08a0) +[comment]: # ( SHA256STAMP:0e54af449933b833f2e74bab9fde46096a79d69b4d958a548c7c0b7cc5654e99) diff --git a/doc/lightning-getlog.7.md b/doc/lightning-getlog.7.md index 130f037f08f8..d4c3942fc06e 100644 --- a/doc/lightning-getlog.7.md +++ b/doc/lightning-getlog.7.md @@ -94,4 +94,4 @@ RESOURCES --------- Main web site: -[comment]: # ( SHA256STAMP:95995a847dd9f3c2d51494a396761b42051e44bb6376de2e3c3e72634e7fd079) +[comment]: # ( SHA256STAMP:0f6e346c57e59aa8ebe0aee9bcb7ded6f66776752e55c4c125f4a80d98cf90fd) diff --git a/doc/lightning-getroute.7.md b/doc/lightning-getroute.7.md index 4d0dd03ad3a1..128afe20af9d 100644 --- a/doc/lightning-getroute.7.md +++ b/doc/lightning-getroute.7.md @@ -281,7 +281,7 @@ RETURN VALUE On success, an object containing **route** is returned. It is an array of objects, where each object contains: - **id** (pubkey): The node at the end of this hop -- **channel** (short_channel_id): The channel joining these nodes +- **channel** (short\_channel\_id): The channel joining these nodes - **direction** (u32): 0 if this channel is traversed from lesser to greater **id**, otherwise 1 - **amount\_msat** (msat): The amount expected by the node at the end of this hop - **delay** (u32): The total CLTV expected by the node at the end of this hop @@ -310,4 +310,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:7aca069c04bac7139f82387d91e0ea148cc42f375c4cb11232189c874be87dcf) +[comment]: # ( SHA256STAMP:e592a238b3701399c1e8de45cb7186b9714742daefa2f33287019f860c1cc24d) diff --git a/doc/lightning-help.7.md b/doc/lightning-help.7.md index 48f460045abf..bf46d269b220 100644 --- a/doc/lightning-help.7.md +++ b/doc/lightning-help.7.md @@ -68,4 +68,4 @@ RESOURCES --------- Main web site: -[comment]: # ( SHA256STAMP:a87a95be3154ca98238cea4abdcb0524a831a0f78998b82eed1041da742ffa4c) +[comment]: # ( SHA256STAMP:48f9ef4d1d73aa13ebd1ffa37107111c35c1a197bbcf00f52c5149847ca57ac1) diff --git a/doc/lightning-invoice.7.md b/doc/lightning-invoice.7.md index e3350ffc3596..218374d4ad49 100644 --- a/doc/lightning-invoice.7.md +++ b/doc/lightning-invoice.7.md @@ -119,4 +119,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:8e72905b6a11d025e5955b9997213d8219e1290cc26307fe517a3e0f19cc818e) +[comment]: # ( SHA256STAMP:4dd2b9d74116f77ad09ad4162ba8438db79e79d1aa99b23e2c993d754327649d) diff --git a/doc/lightning-keysend.7.md b/doc/lightning-keysend.7.md index f69e8c103dc3..39215a7e99ea 100644 --- a/doc/lightning-keysend.7.md +++ b/doc/lightning-keysend.7.md @@ -116,4 +116,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:6aca5a797d5e9bca63bbdc478d5ee0ce1dde592d3a4a4247f75d1831c8e6f38a) +[comment]: # ( SHA256STAMP:d208bd6f3e78b039a4790b8de599ffd819aa169c59430ac487fd7030cd3fe640) diff --git a/doc/lightning-listchannels.7.md b/doc/lightning-listchannels.7.md index c23459e26c73..40076e42b3e8 100644 --- a/doc/lightning-listchannels.7.md +++ b/doc/lightning-listchannels.7.md @@ -35,7 +35,7 @@ On success, an object containing **channels** is returned. It is an array of ob - **source** (pubkey): the source node - **destination** (pubkey): the destination node -- **short\_channel\_id** (short_channel_id): short channel id of channel +- **short\_channel\_id** (short\_channel\_id): short channel id of channel - **public** (boolean): true if this is announced (otherwise it must be our channel) - **amount\_msat** (msat): the total capacity of this channel (always a whole number of satoshis) - **message\_flags** (u8): as defined by BOLT #7 @@ -79,4 +79,4 @@ Lightning RFC site - BOLT \#7: -[comment]: # ( SHA256STAMP:2c4d604d1cec7372129bc863b1e056943abb24d6a354c0e9ae76d8fdecfd4953) +[comment]: # ( SHA256STAMP:baf45b77bd2ba22e245e007b57d8e5f70d06cbf9cebf7ed1431da6a0cf6f367a) diff --git a/doc/lightning-listconfigs.7.md b/doc/lightning-listconfigs.7.md index 237a147b70f5..d611e6ff08cf 100644 --- a/doc/lightning-listconfigs.7.md +++ b/doc/lightning-listconfigs.7.md @@ -215,4 +215,4 @@ RESOURCES --------- Main web site: -[comment]: # ( SHA256STAMP:633de58c810a3d0692e4fe7c58265cf4eec1fe85dffc0139a9af1b23936b61e8) +[comment]: # ( SHA256STAMP:14fa07df1432e7104983afc4fba02cc462237bd1a154ba3f3750355d10ffdadb) diff --git a/doc/lightning-listdatastore.7.md b/doc/lightning-listdatastore.7.md index ed71f94bec28..e3c6e0928d8d 100644 --- a/doc/lightning-listdatastore.7.md +++ b/doc/lightning-listdatastore.7.md @@ -47,4 +47,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:45448ccd8947127b2008b4b7d8ab30bb348a45c9ddbced2c690d8b08a102d058) +[comment]: # ( SHA256STAMP:699f7121a6f1aac9ea8afe39f4bac0e696e97754579d544a141fe2a0e404305f) diff --git a/doc/lightning-listforwards.7.md b/doc/lightning-listforwards.7.md index b661b045673e..150ba7a238cc 100644 --- a/doc/lightning-listforwards.7.md +++ b/doc/lightning-listforwards.7.md @@ -24,11 +24,11 @@ RETURN VALUE [comment]: # (GENERATE-FROM-SCHEMA-START) On success, an object containing **forwards** is returned. It is an array of objects, where each object contains: -- **in\_channel** (short_channel_id): the channel that received the HTLC +- **in\_channel** (short\_channel\_id): the channel that received the HTLC - **in\_msat** (msat): the value of the incoming HTLC - **status** (string): still ongoing, completed, failed locally, or failed after forwarding (one of "offered", "settled", "local_failed", "failed") - **received\_time** (number): the UNIX timestamp when this was received -- **out\_channel** (short_channel_id, optional): the channel that the HTLC (trying to) forward to +- **out\_channel** (short\_channel\_id, optional): the channel that the HTLC (trying to) forward to - **payment\_hash** (hex, optional): payment hash sought by HTLC (always 64 characters) - **style** (string, optional): Either a legacy onion format or a modern tlv format (one of "legacy", "tlv") @@ -63,4 +63,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:e3c26f73040deb441a572d848eda3d6da924c490e5b9ac55c5d87432f4144646) +[comment]: # ( SHA256STAMP:39c71b957590f6a9b321120e7f337216833efd94f0144560da5cd55c91fee35c) diff --git a/doc/lightning-listfunds.7.md b/doc/lightning-listfunds.7.md index d2596e263251..7c8b31292761 100644 --- a/doc/lightning-listfunds.7.md +++ b/doc/lightning-listfunds.7.md @@ -50,11 +50,11 @@ On success, an object is returned, containing: If **state** is "CHANNELD_NORMAL": - - **short\_channel\_id** (short_channel_id): short channel id of channel + - **short\_channel\_id** (short\_channel\_id): short channel id of channel If **state** is "CHANNELD_SHUTTING_DOWN", "CLOSINGD_SIGEXCHANGE", "CLOSINGD_COMPLETE", "AWAITING_UNILATERAL", "FUNDING_SPEND_SEEN" or "ONCHAIN": - - **short\_channel\_id** (short_channel_id, optional): short channel id of channel (only if funding reached lockin depth before closing) + - **short\_channel\_id** (short\_channel\_id, optional): short channel id of channel (only if funding reached lockin depth before closing) [comment]: # (GENERATE-FROM-SCHEMA-END) @@ -73,4 +73,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:319598cb35f3a9c6f336191363b1e38df74b467c0989942b5f4e0a998d0f6339) +[comment]: # ( SHA256STAMP:e5c1f54c8a5008a30648e0fe5883132759fcdabd72bd7e8a00bedc360363e85e) diff --git a/doc/lightning-listinvoices.7.md b/doc/lightning-listinvoices.7.md index df0c33dc19b3..1af9600ce8ce 100644 --- a/doc/lightning-listinvoices.7.md +++ b/doc/lightning-listinvoices.7.md @@ -58,4 +58,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:bfa699310cf025668febb42385b52e6238dfbbc0b5303a28989433d3645495c2) +[comment]: # ( SHA256STAMP:58de6b2fa9e3e796689618bf92a78dac66bb6cfe941d099abd73da3e41bfa60e) diff --git a/doc/lightning-listnodes.7.md b/doc/lightning-listnodes.7.md index f13eed35cee2..63c5bf4af464 100644 --- a/doc/lightning-listnodes.7.md +++ b/doc/lightning-listnodes.7.md @@ -99,4 +99,4 @@ RESOURCES --------- Main web site: -[comment]: # ( SHA256STAMP:452467d60a45d9d685b054644c94a8b7998d5e9f5dd30474006fe9f4f002eb67) +[comment]: # ( SHA256STAMP:7f1378c1376ade1c9912c8eef3ebc77b13cbc5194ee813f8f1b4e0061338e0bb) diff --git a/doc/lightning-listoffers.7.md b/doc/lightning-listoffers.7.md index 6d1a14a7b848..1852270a2106 100644 --- a/doc/lightning-listoffers.7.md +++ b/doc/lightning-listoffers.7.md @@ -81,4 +81,4 @@ RESOURCES --------- Main web site: -[comment]: # ( SHA256STAMP:61677f64d10f6ffad32d19f98273925c5f2a1d9cda47bdb5c44cf5a30a34a62d) +[comment]: # ( SHA256STAMP:ac5b79c1f9b76add7eb08b9940180f2200049509df627cccc1dc892efa488778) diff --git a/doc/lightning-listpays.7.md b/doc/lightning-listpays.7.md index 6ae899217852..2aa4d07c01ac 100644 --- a/doc/lightning-listpays.7.md +++ b/doc/lightning-listpays.7.md @@ -61,4 +61,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:fd723be0ea9b4d6722adad5d325de6cf9c53e1842281205a82ee74ab702a17bd) +[comment]: # ( SHA256STAMP:64fd1d2a8673b2a4189623aa42d44384061ff66ba7c8918af40baf92ac29a889) diff --git a/doc/lightning-listpeers.7.md b/doc/lightning-listpeers.7.md index 6445cff5de5a..56598bf34da6 100644 --- a/doc/lightning-listpeers.7.md +++ b/doc/lightning-listpeers.7.md @@ -53,7 +53,7 @@ On success, an object containing **peers** is returned. It is an array of objec - **perkw** (u32): Feerate per 1000 weight (i.e kSipa) - **perkb** (u32): Feerate per 1000 virtual bytes - **owner** (string, optional): The current subdaemon controlling this connection - - **short\_channel\_id** (short_channel_id, optional): The short_channel_id (once locked in) + - **short\_channel\_id** (short\_channel\_id, optional): The short_channel_id (once locked in) - **channel\_id** (hash, optional): The full channel_id (always 64 characters) - **funding\_txid** (txid, optional): ID of the funding transaction - **funding\_outnum** (u32, optional): The 0-based output number of the funding transaction which opens the channel @@ -98,8 +98,8 @@ On success, an object containing **peers** is returned. It is an array of objec - **our\_to\_self\_delay** (u32, optional): the number of blocks before we can take our funds if we unilateral close - **max\_accepted\_htlcs** (u32, optional): Maximum number of incoming HTLC we will accept at once - **alias** (object, optional): - - **local** (short_channel_id, optional): An alias assigned by this node to this channel, used for outgoing payments - - **remote** (short_channel_id, optional): An alias assigned by the remote node to this channel, usable in routehints and invoices + - **local** (short\_channel\_id, optional): An alias assigned by this node to this channel, used for outgoing payments + - **remote** (short\_channel\_id, optional): An alias assigned by the remote node to this channel, usable in routehints and invoices - **state\_changes** (array of objects, optional): Prior state changes: - **timestamp** (string): UTC timestamp of form YYYY-mm-ddTHH:MM:SS.%03dZ - **old\_state** (string): Previous state (one of "OPENINGD", "CHANNELD_AWAITING_LOCKIN", "CHANNELD_NORMAL", "CHANNELD_SHUTTING_DOWN", "CLOSINGD_SIGEXCHANGE", "CLOSINGD_COMPLETE", "AWAITING_UNILATERAL", "FUNDING_SPEND_SEEN", "ONCHAIN", "DUALOPEND_OPEN_INIT", "DUALOPEND_AWAITING_LOCKIN") @@ -399,4 +399,4 @@ Main web site: Lightning RFC site (BOLT \#9): -[comment]: # ( SHA256STAMP:e80b24123fdeea4eacda71bb7d824b9234bf17c68239ebf7915d2ab747c58fdc) +[comment]: # ( SHA256STAMP:108f43815e3475b88fd9b6a4a8f868e9d729c5d7616e0b0cc2c14f8922f54955) diff --git a/doc/lightning-listsendpays.7.md b/doc/lightning-listsendpays.7.md index 09d873857177..ae642b43cab6 100644 --- a/doc/lightning-listsendpays.7.md +++ b/doc/lightning-listsendpays.7.md @@ -64,4 +64,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:c5d98a40542cb43881bea138bf3da404eba5bc73ed9e0acc8343e0423cc9c602) +[comment]: # ( SHA256STAMP:2cd3f5a0d494ea4aaef6eb5ea9ff467da14198c0fa4d9fee6b45e72568a2d481) diff --git a/doc/lightning-listtransactions.7.md b/doc/lightning-listtransactions.7.md index 7aae61bb6a90..b43e763ff441 100644 --- a/doc/lightning-listtransactions.7.md +++ b/doc/lightning-listtransactions.7.md @@ -38,16 +38,16 @@ On success, an object containing **transactions** is returned. It is an array o - **index** (u32): the output spent - **sequence** (u32): the nSequence value - **type** (string, optional): the purpose of this input (*EXPERIMENTAL_FEATURES* only) (one of "theirs", "deposit", "withdraw", "channel_funding", "channel_mutual_close", "channel_unilateral_close", "channel_sweep", "channel_htlc_success", "channel_htlc_timeout", "channel_penalty", "channel_unilateral_cheat") - - **channel** (short_channel_id, optional): the channel this input is associated with (*EXPERIMENTAL_FEATURES* only) + - **channel** (short\_channel\_id, optional): the channel this input is associated with (*EXPERIMENTAL_FEATURES* only) - **outputs** (array of objects): Each output, in order: - **index** (u32): the 0-based output number - **amount\_msat** (msat): the amount of the output - **scriptPubKey** (hex): the scriptPubKey - **type** (string, optional): the purpose of this output (*EXPERIMENTAL_FEATURES* only) (one of "theirs", "deposit", "withdraw", "channel_funding", "channel_mutual_close", "channel_unilateral_close", "channel_sweep", "channel_htlc_success", "channel_htlc_timeout", "channel_penalty", "channel_unilateral_cheat") - - **channel** (short_channel_id, optional): the channel this output is associated with (*EXPERIMENTAL_FEATURES* only) + - **channel** (short\_channel\_id, optional): the channel this output is associated with (*EXPERIMENTAL_FEATURES* only) - **type** (array of strings, optional): - Reason we care about this transaction (*EXPERIMENTAL_FEATURES* only) (one of "theirs", "deposit", "withdraw", "channel_funding", "channel_mutual_close", "channel_unilateral_close", "channel_sweep", "channel_htlc_success", "channel_htlc_timeout", "channel_penalty", "channel_unilateral_cheat") -- **channel** (short_channel_id, optional): the channel this transaction is associated with (*EXPERIMENTAL_FEATURES* only) +- **channel** (short\_channel\_id, optional): the channel this transaction is associated with (*EXPERIMENTAL_FEATURES* only) [comment]: # (GENERATE-FROM-SCHEMA-END) @@ -105,4 +105,4 @@ RESOURCES --------- Main web site: -[comment]: # ( SHA256STAMP:e1f4e86db0fd48d695ad0c30ace5dea6f40e1502847a258ef9580e30b52712f7) +[comment]: # ( SHA256STAMP:f7c39908eaa1a2561597c8f97658b873953daab0a68ed2e9b68e434a55d55efe) diff --git a/doc/lightning-makesecret.7.md b/doc/lightning-makesecret.7.md index 283b204cc08f..2a713ded4c2c 100644 --- a/doc/lightning-makesecret.7.md +++ b/doc/lightning-makesecret.7.md @@ -42,4 +42,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:47f98983bc74e75b5e9ad55ebc84771a7819717e8e41f2398d0e0227a8670044) +[comment]: # ( SHA256STAMP:0ef7c3e2172219fa647d1c447cb82daa7857c6c53a27fd191bff83f59ce6b9f7) diff --git a/doc/lightning-multifundchannel.7.md b/doc/lightning-multifundchannel.7.md index 93a8190c67cf..54f827af5326 100644 --- a/doc/lightning-multifundchannel.7.md +++ b/doc/lightning-multifundchannel.7.md @@ -159,4 +159,4 @@ RESOURCES --------- Main web site: -[comment]: # ( SHA256STAMP:d5af7087b3e31d80df0ce5c09c55b51141bfbf158802d7f5cd82caa21110453e) +[comment]: # ( SHA256STAMP:a507d57bbf36455924497c8354f41e225bc16f63f12fe01b4f7c4af37f0c6960) diff --git a/doc/lightning-multiwithdraw.7.md b/doc/lightning-multiwithdraw.7.md index b5a63c0fa2b2..c090387d74ee 100644 --- a/doc/lightning-multiwithdraw.7.md +++ b/doc/lightning-multiwithdraw.7.md @@ -72,4 +72,4 @@ RESOURCES --------- Main web site: -[comment]: # ( SHA256STAMP:3c79c00a7115ea353d0eb27b8fb6db0203dbd40226291fc0b5f57bc29bd8acc8) +[comment]: # ( SHA256STAMP:6c0054088c17481dedbedb6a5ed4be7f09ce8783780707432907508ebf4bbd7a) diff --git a/doc/lightning-newaddr.7.md b/doc/lightning-newaddr.7.md index 6ac38029ec04..1c47a13b4129 100644 --- a/doc/lightning-newaddr.7.md +++ b/doc/lightning-newaddr.7.md @@ -58,4 +58,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:0d4165582ac09b6f130bd6910873f5073ab7ff852711fa1fb45177726a978899) +[comment]: # ( SHA256STAMP:e9650b5f1f4374007c8fde63dae2ac9981c952ed8074aabade39fcc0ebe21333) diff --git a/doc/lightning-notifications.7.md b/doc/lightning-notifications.7.md index fefa8de8a5b1..3940d12ab91f 100644 --- a/doc/lightning-notifications.7.md +++ b/doc/lightning-notifications.7.md @@ -102,4 +102,4 @@ RESOURCES --------- Main web site: -[comment]: # ( SHA256STAMP:4d9f888d10faca2bf94d1b52510cf21fbeebae4efda0946f03d04b0ef4bc88a2) +[comment]: # ( SHA256STAMP:326e5801f65998e13e909d8b682e9fbc9824f3a43aa7da1d76b871882e52f293) diff --git a/doc/lightning-offer.7.md b/doc/lightning-offer.7.md index 8818c6f3c9e5..26e689b923ba 100644 --- a/doc/lightning-offer.7.md +++ b/doc/lightning-offer.7.md @@ -135,4 +135,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:62546f8bd62788615d20aa1881fc55328bea3fd3793d4395984972cbf33c7219) +[comment]: # ( SHA256STAMP:aa7544c07d3d84963e43500a367ceb62ebab8f5ae26de1dd39bb087f928dcaee) diff --git a/doc/lightning-offerout.7.md b/doc/lightning-offerout.7.md index 9d632356ec9d..968a0ffa39cf 100644 --- a/doc/lightning-offerout.7.md +++ b/doc/lightning-offerout.7.md @@ -100,4 +100,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:e13d4ef2c90ce11239857da6cab6489ddbaae473b31f2f10d8e5d1cd46e952a3) +[comment]: # ( SHA256STAMP:7c0f75ca64bdcce2467f42d7671caccf5f7bf6eb97fb3edef1e39f2fdb87b4d8) diff --git a/doc/lightning-openchannel_abort.7.md b/doc/lightning-openchannel_abort.7.md index a88ed1045995..fdfd60c74e63 100644 --- a/doc/lightning-openchannel_abort.7.md +++ b/doc/lightning-openchannel_abort.7.md @@ -55,4 +55,4 @@ RESOURCES --------- Main web site: -[comment]: # ( SHA256STAMP:b02ee781aadf998bf031e8e797622ae9a6307c6c3a0c6d1fdaa3760cbbc6c0c6) +[comment]: # ( SHA256STAMP:ed449af5b443c981faaff360cb2276816bbc7cd80f85fdb4403987c29d65baed) diff --git a/doc/lightning-openchannel_bump.7.md b/doc/lightning-openchannel_bump.7.md index 2e9846de33d7..1af6590d3e70 100644 --- a/doc/lightning-openchannel_bump.7.md +++ b/doc/lightning-openchannel_bump.7.md @@ -81,4 +81,4 @@ RESOURCES --------- Main web site: -[comment]: # ( SHA256STAMP:40407dc22bff8d157f1f87683e8b97ab6a0495ec1454e5ef05d4a050eb10dfc8) +[comment]: # ( SHA256STAMP:3cba5d1c16925322754eae979e956132e8b94e40da0dee6925037a8854d9b791) diff --git a/doc/lightning-openchannel_init.7.md b/doc/lightning-openchannel_init.7.md index 2b9916ce5197..261afb2719ca 100644 --- a/doc/lightning-openchannel_init.7.md +++ b/doc/lightning-openchannel_init.7.md @@ -103,4 +103,4 @@ RESOURCES --------- Main web site: -[comment]: # ( SHA256STAMP:f78d8a4c015cad1e5065d8ae23375aa33bd9f318cd526ee88f65cccb6cda6ad9) +[comment]: # ( SHA256STAMP:18421f03dece31aafe32cb1a9b520dd6b898e018cb187de6d666e391232fab4e) diff --git a/doc/lightning-openchannel_signed.7.md b/doc/lightning-openchannel_signed.7.md index 9111eab70d96..e62cad7336e3 100644 --- a/doc/lightning-openchannel_signed.7.md +++ b/doc/lightning-openchannel_signed.7.md @@ -67,4 +67,4 @@ RESOURCES --------- Main web site: -[comment]: # ( SHA256STAMP:7e31569a2b356664ff818c9afc8347aa2dcd1ba128ff9a5f74fda6f441aa5904) +[comment]: # ( SHA256STAMP:41e2a4aed1aaac01675f99e91326197afa370a05e32b2ef20cbbb8247de57289) diff --git a/doc/lightning-openchannel_update.7.md b/doc/lightning-openchannel_update.7.md index f05b35060814..f48cdd1287c2 100644 --- a/doc/lightning-openchannel_update.7.md +++ b/doc/lightning-openchannel_update.7.md @@ -72,4 +72,4 @@ RESOURCES --------- Main web site: -[comment]: # ( SHA256STAMP:b1a1c34c05ff7f47d9ff790eb17d8df4ccfcfabf8471958fec8bf97ddebfc45d) +[comment]: # ( SHA256STAMP:14632f65d4c44b34762d3fa7e0f5b823a519d3dc5fc7a2a69f677000efd937fb) diff --git a/doc/lightning-parsefeerate.7.md b/doc/lightning-parsefeerate.7.md index 139fb704a41b..1d53de74142b 100644 --- a/doc/lightning-parsefeerate.7.md +++ b/doc/lightning-parsefeerate.7.md @@ -44,4 +44,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:cf5309537ecb4aa57a6a74e607d1c0d581df22c43aa5d62a90d4eb43e63237f0) +[comment]: # ( SHA256STAMP:62a45d5091e5bdb4581a2986a66681616315999b8497038864ece8e3308c3f50) diff --git a/doc/lightning-pay.7.md b/doc/lightning-pay.7.md index f7f6add17d30..04e03cef7dc7 100644 --- a/doc/lightning-pay.7.md +++ b/doc/lightning-pay.7.md @@ -167,4 +167,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:24e27fab68719a3d6bae0e845cba95223d8c18a4f4c9a045225898cbd6abc2ef) +[comment]: # ( SHA256STAMP:6f7640af4859e4605f4369a4e17fcfbaead1be53928ad8101cc44fde6f441a97) diff --git a/doc/lightning-ping.7.md b/doc/lightning-ping.7.md index 8f03facb2bea..5ed7c9dc6c8b 100644 --- a/doc/lightning-ping.7.md +++ b/doc/lightning-ping.7.md @@ -70,4 +70,4 @@ RESOURCES --------- Main web site: -[comment]: # ( SHA256STAMP:6c9c92f2387bb0108495d45cf2919203a805bd78db8a2d2a88ada80e881c04e3) +[comment]: # ( SHA256STAMP:f33aa4d93ca623ff7cd5e4062e0533f617b00372797f8ee0d2498479d2fe08a9) diff --git a/doc/lightning-plugin.7.md b/doc/lightning-plugin.7.md index 1579bb5b1398..9da161408587 100644 --- a/doc/lightning-plugin.7.md +++ b/doc/lightning-plugin.7.md @@ -84,4 +84,4 @@ RESOURCES Main web site: [writing plugins]: PLUGINS.md -[comment]: # ( SHA256STAMP:17dc5bb65dc652ab4dee5fda0c3c9a909edc931c357773cbc988aede3d9fb49a) +[comment]: # ( SHA256STAMP:3d7e6647d7fb3eab2a8c6361bb0cbe60efbd822f30f31e08cce68e2aa41ba532) diff --git a/doc/lightning-reserveinputs.7.md b/doc/lightning-reserveinputs.7.md index 98e161d656f2..0225de9c238a 100644 --- a/doc/lightning-reserveinputs.7.md +++ b/doc/lightning-reserveinputs.7.md @@ -64,4 +64,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:f0aed27b4a1de3f76f62ba9882df18c596e017491ff04614666ce05bc8bb2535) +[comment]: # ( SHA256STAMP:7fd7e24084f7e7da57bccd98cbcf511be56e44e282813c964bdd69d0785dfd22) diff --git a/doc/lightning-sendcustommsg.7.md b/doc/lightning-sendcustommsg.7.md index 436183d08c11..10e15a604e13 100644 --- a/doc/lightning-sendcustommsg.7.md +++ b/doc/lightning-sendcustommsg.7.md @@ -69,4 +69,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:a4314cf59d13dee507086aa5353a1456238a4e57e4a166bdd0a2fa66a4be3736) +[comment]: # ( SHA256STAMP:fded86dbe217eacf0c170db87140fd5f10f23c22760ac08b7aa4d2faa4764b3a) diff --git a/doc/lightning-sendinvoice.7.md b/doc/lightning-sendinvoice.7.md index 37f27df9a6f2..806594556a08 100644 --- a/doc/lightning-sendinvoice.7.md +++ b/doc/lightning-sendinvoice.7.md @@ -80,4 +80,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:adff5e5f321dc5245067f4ed6ad9a404f5f4a783ae5ab2715a9064cbd570f7f1) +[comment]: # ( SHA256STAMP:23d06329b3d5d2d21639ecc152b541788bb204188c24a0294f97582401b2b3dc) diff --git a/doc/lightning-sendonion.7.md b/doc/lightning-sendonion.7.md index 8bc0152eefff..86306b393ba0 100644 --- a/doc/lightning-sendonion.7.md +++ b/doc/lightning-sendonion.7.md @@ -135,4 +135,4 @@ RESOURCES Main web site: [bolt04]: https://github.com/lightningnetwork/lightning-rfc/blob/master/04-onion-routing.md -[comment]: # ( SHA256STAMP:f98e537a7fe2e1b3f9bc10366317c1f1663e0fc6c6618564c38cc10181161658) +[comment]: # ( SHA256STAMP:84283d16d289b6f72ffac0fdca6791bb49ac9ec1ef2bbb06028c18453bb15f02) diff --git a/doc/lightning-sendonionmessage.7.md b/doc/lightning-sendonionmessage.7.md index 1549d25d579a..69d7157726bc 100644 --- a/doc/lightning-sendonionmessage.7.md +++ b/doc/lightning-sendonionmessage.7.md @@ -43,4 +43,4 @@ Main web site: [bolt04]: https://github.com/lightningnetwork/lightning-rfc/blob/master/04-onion-routing.md -[comment]: # ( SHA256STAMP:8e7f2c4372f12ee7f79df114e9ac9539ad6b19821e6c808e47d1ba9f7981e8ea) +[comment]: # ( SHA256STAMP:200de829c6635242cb2dd8ec0650c2fa8f5fcbf413f4a704884516df80492fcb) diff --git a/doc/lightning-sendpay.7.md b/doc/lightning-sendpay.7.md index b834bd391753..fc9a656311ae 100644 --- a/doc/lightning-sendpay.7.md +++ b/doc/lightning-sendpay.7.md @@ -142,4 +142,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:9b56a1eedebe426c6ed6018fa92f963884b8aea2787d602e1e413c2f79884ce0) +[comment]: # ( SHA256STAMP:4878733d02711f919c49740652a3723fbcc78a0cd865b71385db965c878d2b77) diff --git a/doc/lightning-sendpsbt.7.md b/doc/lightning-sendpsbt.7.md index 2dd0cfe97464..2829e58f9a65 100644 --- a/doc/lightning-sendpsbt.7.md +++ b/doc/lightning-sendpsbt.7.md @@ -66,4 +66,4 @@ RESOURCES --------- Main web site: -[comment]: # ( SHA256STAMP:3c79c00a7115ea353d0eb27b8fb6db0203dbd40226291fc0b5f57bc29bd8acc8) +[comment]: # ( SHA256STAMP:6c0054088c17481dedbedb6a5ed4be7f09ce8783780707432907508ebf4bbd7a) diff --git a/doc/lightning-setchannel.7.md b/doc/lightning-setchannel.7.md index 98f93ed3c4dd..602cf3f72b15 100644 --- a/doc/lightning-setchannel.7.md +++ b/doc/lightning-setchannel.7.md @@ -74,7 +74,7 @@ On success, an object containing **channels** is returned. It is an array of ob - **fee\_proportional\_millionths** (u32): The resulting feeppm (this is the BOLT #7 name) - **minimum\_htlc\_out\_msat** (msat): The resulting htlcmin we will advertize (the BOLT #7 name is htlc_minimum_msat) - **maximum\_htlc\_out\_msat** (msat): The resulting htlcmax we will advertize (the BOLT #7 name is htlc_maximum_msat) -- **short\_channel\_id** (short_channel_id, optional): the short_channel_id (if locked in) +- **short\_channel\_id** (short\_channel\_id, optional): the short_channel_id (if locked in) - the following warnings are possible: - **warning\_htlcmin\_too\_low**: The requested htlcmin was too low for this peer, so we set it to the minimum they will allow - **warning\_htlcmax\_too\_high**: The requested htlcmax was greater than the channel capacity, so we set it to the channel capacity @@ -107,4 +107,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:28a16d5b1392dd72f9d7a040ce8e37907114fbaf1aed106314fab3f9126afba2) +[comment]: # ( SHA256STAMP:0f7cd751f329360a8cd957dfc8ea0b7d579aa05f4de4f8577039e50266a04f30) diff --git a/doc/lightning-setchannelfee.7.md b/doc/lightning-setchannelfee.7.md index 30c39072d127..f31f0030b8db 100644 --- a/doc/lightning-setchannelfee.7.md +++ b/doc/lightning-setchannelfee.7.md @@ -54,7 +54,7 @@ On success, an object is returned, containing: - **channels** (array of objects): channel(s) whose rate is now set: - **peer\_id** (pubkey): The node_id of the peer - **channel\_id** (hex): The channel_id of the channel (always 64 characters) - - **short\_channel\_id** (short_channel_id, optional): the short_channel_id (if locked in) + - **short\_channel\_id** (short\_channel\_id, optional): the short_channel_id (if locked in) [comment]: # (GENERATE-FROM-SCHEMA-END) @@ -83,4 +83,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:bd5af1e2190426012541af0eb582ca22461fb38ec70c7a235f4e7e92f7fc565d) +[comment]: # ( SHA256STAMP:a7f079e9a25ee5f4c3d8bf3ed2c61d2f807eae99e6bfe02b0737a9692aca503b) diff --git a/doc/lightning-signmessage.7.md b/doc/lightning-signmessage.7.md index d94b2c3980be..71f82901602d 100644 --- a/doc/lightning-signmessage.7.md +++ b/doc/lightning-signmessage.7.md @@ -42,4 +42,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:cf7372c221ee6846fb8e7aca3e841b687e4b4f21262a0cc8a430b375e17e70cb) +[comment]: # ( SHA256STAMP:6ff35aee05f86de2c44be50a156afc1e325183d8c9333bff68114c8d846a75e6) diff --git a/doc/lightning-signpsbt.7.md b/doc/lightning-signpsbt.7.md index 197a219da81a..2effa067c9f5 100644 --- a/doc/lightning-signpsbt.7.md +++ b/doc/lightning-signpsbt.7.md @@ -72,4 +72,4 @@ RESOURCES --------- Main web site: -[comment]: # ( SHA256STAMP:79690a411b6db6801192bd462e2cf2c627a0a10e65a326e2801dc0e35e734714) +[comment]: # ( SHA256STAMP:0daef100b12490126849fcb93a9e861554807d1a5acf68bc17de92a30505e18a) diff --git a/doc/lightning-stop.7.md b/doc/lightning-stop.7.md index 198d3eb0bf35..fb6c3c911cbe 100644 --- a/doc/lightning-stop.7.md +++ b/doc/lightning-stop.7.md @@ -42,4 +42,4 @@ RESOURCES --------- Main web site: -[comment]: # ( SHA256STAMP:cd6076ec79da278cca6f68be0560d71dc1b46651c3db48d81aafe1d19da0ff96) +[comment]: # ( SHA256STAMP:2103952683449a5aa313eefa9c850dc0ae1cf4aa65edeb7897a8748a010a9349) diff --git a/doc/lightning-txdiscard.7.md b/doc/lightning-txdiscard.7.md index 51f3da93bd81..22d5292a31bd 100644 --- a/doc/lightning-txdiscard.7.md +++ b/doc/lightning-txdiscard.7.md @@ -45,4 +45,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:d763d6dda590b36227f606a404223327147606b495a20926d14a0f8444effdd7) +[comment]: # ( SHA256STAMP:f52ad03cccaea672deefada22f0a11acff9d0c4f98ccfedca12759eaa6bac057) diff --git a/doc/lightning-txprepare.7.md b/doc/lightning-txprepare.7.md index 7cb6f754c795..e885f8dafff6 100644 --- a/doc/lightning-txprepare.7.md +++ b/doc/lightning-txprepare.7.md @@ -85,4 +85,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:d0570b649a356bb7575da21dfe2f6287fe0a0eac388411470fa22897f7175b83) +[comment]: # ( SHA256STAMP:c13561bf71189143811cd4bd49db69c163b8443f1660931671eb1e95e0a7e3ff) diff --git a/doc/lightning-txsend.7.md b/doc/lightning-txsend.7.md index d020c4f5aea6..abba2b31d199 100644 --- a/doc/lightning-txsend.7.md +++ b/doc/lightning-txsend.7.md @@ -45,4 +45,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:8a96f2a5dd68a060602176385238fc7a9255928eef6d5b7f68916eaeb60428f3) +[comment]: # ( SHA256STAMP:dcb4d5f03b44bf3bc6852f97f56c0ac7d34505df71f042ed86a0daf4927dcaff) diff --git a/doc/lightning-unreserveinputs.7.md b/doc/lightning-unreserveinputs.7.md index 82ddb5831083..93f4fe078054 100644 --- a/doc/lightning-unreserveinputs.7.md +++ b/doc/lightning-unreserveinputs.7.md @@ -55,4 +55,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:d5ec7b9dba4387f8f1c59f1d97fe00cc8abcab793c0bb23f3bc32b02b7e2e882) +[comment]: # ( SHA256STAMP:41e0fba4aea57e12d91366a55663e7331e952b223eeb8fc9f83deb5a948f63b4) diff --git a/doc/lightning-utxopsbt.7.md b/doc/lightning-utxopsbt.7.md index 0be62bad7d1c..d2ea02688443 100644 --- a/doc/lightning-utxopsbt.7.md +++ b/doc/lightning-utxopsbt.7.md @@ -100,4 +100,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:0fa67418b5d62dc8dd0ccdbda4113da73a3d7761e23c2ad697a533783c43c37d) +[comment]: # ( SHA256STAMP:c2c513b40099c9cd2ef7bda1c430fdff055499b67ef2ff9edf7772ea4d87fb2d) diff --git a/doc/lightning-waitanyinvoice.7.md b/doc/lightning-waitanyinvoice.7.md index cc6859b7b590..a2f3c8f9d90d 100644 --- a/doc/lightning-waitanyinvoice.7.md +++ b/doc/lightning-waitanyinvoice.7.md @@ -75,4 +75,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:016afebade3ee5a7ac5abbd125f8db78f6c8b41f0e510c8f4c3b6a385e6f3a26) +[comment]: # ( SHA256STAMP:2b0c9e70bb03f5cf9999731fdf5b8bcd761ea70ef6fc04575a1c2451174ea769) diff --git a/doc/lightning-waitblockheight.7.md b/doc/lightning-waitblockheight.7.md index f773a5178365..801bfb8d3d8c 100644 --- a/doc/lightning-waitblockheight.7.md +++ b/doc/lightning-waitblockheight.7.md @@ -39,4 +39,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:4419a83c7852353e07eaa8ac3e6786c6b1d714a9a3d981fc78adfe4a73008514) +[comment]: # ( SHA256STAMP:e84e2ddf33c5abafe434ad0dcd76a3c1e6e2a2bdbba5dcf786f2a2ed80e61061) diff --git a/doc/lightning-waitinvoice.7.md b/doc/lightning-waitinvoice.7.md index 94207e966d5d..6000f5063dce 100644 --- a/doc/lightning-waitinvoice.7.md +++ b/doc/lightning-waitinvoice.7.md @@ -60,4 +60,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:016afebade3ee5a7ac5abbd125f8db78f6c8b41f0e510c8f4c3b6a385e6f3a26) +[comment]: # ( SHA256STAMP:2b0c9e70bb03f5cf9999731fdf5b8bcd761ea70ef6fc04575a1c2451174ea769) diff --git a/doc/lightning-waitsendpay.7.md b/doc/lightning-waitsendpay.7.md index 0cd670e3b455..0ec7abca750b 100644 --- a/doc/lightning-waitsendpay.7.md +++ b/doc/lightning-waitsendpay.7.md @@ -103,4 +103,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:30601f9dab9b0168e7db387cdd9d6750116f9adad8f125f0bac507a79f9bcf67) +[comment]: # ( SHA256STAMP:b87ddb42fd2b1182ef11101f0298be2e4de9b942fd3b8b4b169d1bdc849f48a8) diff --git a/doc/lightning-withdraw.7.md b/doc/lightning-withdraw.7.md index 74301e97111c..6a52452e78fa 100644 --- a/doc/lightning-withdraw.7.md +++ b/doc/lightning-withdraw.7.md @@ -74,4 +74,4 @@ RESOURCES Main web site: -[comment]: # ( SHA256STAMP:bbb1e5637721b3415ff3498d141f9da7d38bd75b297f5c0d262e838314dd2f37) +[comment]: # ( SHA256STAMP:fcfd3c91a3cee9bbd36e86edccb5d6407b19c2beda7de1f51ebba5fbd1c2340a) diff --git a/doc/schemas/sendcustommsg.schema.json b/doc/schemas/sendcustommsg.schema.json index cc61e6190979..3c9db46a3ceb 100644 --- a/doc/schemas/sendcustommsg.schema.json +++ b/doc/schemas/sendcustommsg.schema.json @@ -1,6 +1,7 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", + "additionalProperties": false, "required": [ "status" ], diff --git a/lightningd/gossip_control.c b/lightningd/gossip_control.c index a240e11accdc..5fcd4f798d79 100644 --- a/lightningd/gossip_control.c +++ b/lightningd/gossip_control.c @@ -125,9 +125,9 @@ static void handle_local_channel_update(struct lightningd *ld, const u8 *msg) * us. */ channel = any_channel_by_scid(ld, &scid, true); if (!channel) { - log_broken(ld->log, "Local update for bad scid %s", - type_to_string(tmpctx, struct short_channel_id, - &scid)); + log_unusual(ld->log, "Local update for bad scid %s", + type_to_string(tmpctx, struct short_channel_id, + &scid)); return; } diff --git a/lightningd/jsonrpc.c b/lightningd/jsonrpc.c index 357297f2f3a4..1904184a9693 100644 --- a/lightningd/jsonrpc.c +++ b/lightningd/jsonrpc.c @@ -933,11 +933,6 @@ parse_request(struct json_connection *jcon, const jsmntok_t tok[]) json_tok_full(jcon->buffer, method)); } - if (jcon->ld->state == LD_STATE_SHUTDOWN) { - return command_fail(c, LIGHTNINGD_SHUTDOWN, - "lightningd is shutting down"); - } - rpc_hook = tal(c, struct rpc_command_hook_payload); rpc_hook->cmd = c; /* Duplicate since we might outlive the connection */ @@ -1268,8 +1263,21 @@ void jsonrpc_listen(struct jsonrpc *jsonrpc, struct lightningd *ld) if (listen(fd, 128) != 0) err(1, "Listening on '%s'", rpc_filename); - jsonrpc->rpc_listener = io_new_listener( - ld->rpc_filename, fd, incoming_jcon_connected, ld); + + /* All conns will be tal children of jsonrpc: good for freeing later! */ + jsonrpc->rpc_listener + = io_new_listener(jsonrpc, fd, incoming_jcon_connected, ld); +} + +void jsonrpc_stop_listening(struct jsonrpc *jsonrpc) +{ + jsonrpc->rpc_listener = tal_free(jsonrpc->rpc_listener); +} + +void jsonrpc_stop_all(struct lightningd *ld) +{ + /* Closes all conns. */ + ld->jsonrpc = tal_free(ld->jsonrpc); } static struct command_result *param_command(struct command *cmd, diff --git a/lightningd/jsonrpc.h b/lightningd/jsonrpc.h index 8f090801e464..43ed29b30f9c 100644 --- a/lightningd/jsonrpc.h +++ b/lightningd/jsonrpc.h @@ -173,12 +173,24 @@ void jsonrpc_setup(struct lightningd *ld); /** - * Start listeing on ld->rpc_filename. + * Start listening on ld->rpc_filename. * * Sets up the listener effectively starting the RPC interface. */ void jsonrpc_listen(struct jsonrpc *rpc, struct lightningd *ld); +/** + * Stop listening on ld->rpc_filename. + * + * No new connections from here in. + */ +void jsonrpc_stop_listening(struct jsonrpc *jsonrpc); + +/** + * Kill any remaining JSON-RPC connections. + */ +void jsonrpc_stop_all(struct lightningd *ld); + /** * Add a new command/method to the JSON-RPC interface. * diff --git a/lightningd/lightningd.c b/lightningd/lightningd.c index 39e561e02ddf..288b589e2bcb 100644 --- a/lightningd/lightningd.c +++ b/lightningd/lightningd.c @@ -515,7 +515,7 @@ static const char *find_daemon_dir(struct lightningd *ld, const char *argv0) * is an awesome runtime memory usage detector for C and C++ programs). In * some ways it would be neater not to do this, but it turns out some * transient objects still need cleaning. */ -static void shutdown_subdaemons(struct lightningd *ld) +static void free_all_channels(struct lightningd *ld) { struct peer *p; @@ -529,19 +529,6 @@ static void shutdown_subdaemons(struct lightningd *ld) * writes, which must be inside a transaction. */ db_begin_transaction(ld->wallet->db); - /* Let everyone shutdown cleanly. */ - close(ld->hsm_fd); - /*~ The three "global" daemons, which we shutdown explicitly: we - * give them 10 seconds to exit gracefully before killing them. */ - ld->connectd = subd_shutdown(ld->connectd, 10); - ld->gossip = subd_shutdown(ld->gossip, 10); - ld->hsm = subd_shutdown(ld->hsm, 10); - - /*~ Closing the hsmd means all other subdaemons should be exiting; - * deal with that cleanly before we start freeing internal - * structures. */ - subd_shutdown_remaining(ld); - /* Now we free all the HTLCs */ free_htlcs(ld, NULL); @@ -579,6 +566,18 @@ static void shutdown_subdaemons(struct lightningd *ld) db_commit_transaction(ld->wallet->db); } +static void shutdown_global_subdaemons(struct lightningd *ld) +{ + /* Let everyone shutdown cleanly. */ + close(ld->hsm_fd); + + /*~ The three "global" daemons, which we shutdown explicitly: we + * give them 10 seconds to exit gracefully before killing them. */ + ld->connectd = subd_shutdown(ld->connectd, 10); + ld->gossip = subd_shutdown(ld->gossip, 10); + ld->hsm = subd_shutdown(ld->hsm, 10); +} + /*~ Our wallet logic needs to know what outputs we might be interested in. We * use BIP32 (a.k.a. "HD wallet") to generate keys from a single seed, so we * keep the maximum-ever-used key index in the db, and add them all to the @@ -1200,7 +1199,10 @@ int main(int argc, char *argv[]) assert(io_loop_ret == ld); log_debug(ld->log, "io_loop_with_timers: %s", __func__); - /* Fail JSON RPC requests and ignore plugin's responses */ + /* Stop *new* JSON RPC requests. */ + jsonrpc_stop_listening(ld->jsonrpc); + + /* Give permission for things to get destroyed without getting upset. */ ld->state = LD_STATE_SHUTDOWN; stop_fd = -1; @@ -1221,13 +1223,24 @@ int main(int argc, char *argv[]) /* We're not going to collect our children. */ remove_sigchild_handler(sigchld_conn); - shutdown_subdaemons(ld); - /* Tell plugins we're shutting down, closes the db. */ + /* Get rid of per-channel subdaemons. */ + subd_shutdown_nonglobals(ld); + + /* Tell plugins we're shutting down, use force if necessary. */ shutdown_plugins(ld); - /* Cleanup JSON RPC separately: destructors assume some list_head * in ld */ - tal_free(ld->jsonrpc); + /* Now kill any remaining connections */ + jsonrpc_stop_all(ld); + + /* Get rid of major subdaemons. */ + shutdown_global_subdaemons(ld); + + /* Clean up internal peer/channel/htlc structures. */ + free_all_channels(ld); + + /* Now close database */ + ld->wallet->db = tal_free(ld->wallet->db); /* Clean our our HTLC maps, since they use malloc. */ htlc_in_map_clear(&ld->htlcs_in); diff --git a/lightningd/plugin.c b/lightningd/plugin.c index ea9fb5c75872..df7aa545a0ec 100644 --- a/lightningd/plugin.c +++ b/lightningd/plugin.c @@ -581,11 +581,6 @@ static const char *plugin_response_handle(struct plugin *plugin, "Received a JSON-RPC response for non-existent request"); } - /* Ignore responses when shutting down */ - if (plugin->plugins->ld->state == LD_STATE_SHUTDOWN) { - return NULL; - } - /* We expect the request->cb to copy if needed */ pd = plugin_detect_destruction(plugin); request->response_cb(plugin->buffer, toks, idtok, request->response_cb_arg); @@ -2124,9 +2119,6 @@ void shutdown_plugins(struct lightningd *ld) { struct plugin *p, *next; - /* The next io_loop does not need db access, close it. */ - ld->wallet->db = tal_free(ld->wallet->db); - /* Tell them all to shutdown; if they care. */ list_for_each_safe(&ld->plugins->plugins, p, next, list) { /* Kill immediately, deletes self from list. */ diff --git a/lightningd/plugin_hook.c b/lightningd/plugin_hook.c index afab5785f59b..b8d7322f4094 100644 --- a/lightningd/plugin_hook.c +++ b/lightningd/plugin_hook.c @@ -167,7 +167,8 @@ static void plugin_hook_callback(const char *buffer, const jsmntok_t *toks, tal_del_destructor(last, plugin_hook_killed); tal_free(last); - if (r->ld->state == LD_STATE_SHUTDOWN) { + /* Actually, if it dies during shutdown, *don't* process result! */ + if (!buffer && r->ld->state == LD_STATE_SHUTDOWN) { log_debug(r->ld->log, "Abandoning plugin hook call due to shutdown"); return; diff --git a/lightningd/subd.c b/lightningd/subd.c index 4ee11c1c257e..ac151d184737 100644 --- a/lightningd/subd.c +++ b/lightningd/subd.c @@ -902,15 +902,13 @@ struct subd *subd_shutdown(struct subd *sd, unsigned int seconds) return tal_free(sd); } -void subd_shutdown_remaining(struct lightningd *ld) +void subd_shutdown_nonglobals(struct lightningd *ld) { - struct subd *subd; + struct subd *subd, *next; - /* We give them a second to finish exiting, before we kill - * them in destroy_subd() */ - sleep(1); - - while ((subd = list_top(&ld->subds, struct subd, list)) != NULL) { + list_for_each_safe(&ld->subds, subd, next, list) { + if (!subd->channel) + continue; /* Destructor removes from list */ io_close(subd->conn); } diff --git a/lightningd/subd.h b/lightningd/subd.h index db0fd6afa219..f43436b2b5d6 100644 --- a/lightningd/subd.h +++ b/lightningd/subd.h @@ -211,7 +211,7 @@ struct subd_req *subd_req_(const tal_t *ctx, void subd_release_channel(struct subd *owner, const void *channel); /** - * subd_shutdown - try to politely shut down a subdaemon. + * subd_shutdown - try to politely shut down a (global) subdaemon. * @subd: subd to shutdown. * @seconds: maximum seconds to wait for it to exit. * @@ -225,13 +225,10 @@ void subd_release_channel(struct subd *owner, const void *channel); struct subd *subd_shutdown(struct subd *subd, unsigned int seconds); /** - * subd_shutdown_remaining - kill all remaining (per-peer) subds + * subd_shutdown_nonglobals - kill all per-peer subds * @ld: lightningd - * - * They should already be exiting (since we shutdown hsmd), but - * make sure they have. */ -void subd_shutdown_remaining(struct lightningd *ld); +void subd_shutdown_nonglobals(struct lightningd *ld); /* Ugly helper to get full pathname of the current binary. */ const char *find_my_abspath(const tal_t *ctx, const char *argv0); diff --git a/lightningd/test/run-find_my_abspath.c b/lightningd/test/run-find_my_abspath.c index 585eb5328dc4..85fd5fcf9029 100644 --- a/lightningd/test/run-find_my_abspath.c +++ b/lightningd/test/run-find_my_abspath.c @@ -117,6 +117,12 @@ void jsonrpc_listen(struct jsonrpc *rpc UNNEEDED, struct lightningd *ld UNNEEDED /* Generated stub for jsonrpc_setup */ void jsonrpc_setup(struct lightningd *ld UNNEEDED) { fprintf(stderr, "jsonrpc_setup called!\n"); abort(); } +/* Generated stub for jsonrpc_stop_all */ +void jsonrpc_stop_all(struct lightningd *ld UNNEEDED) +{ fprintf(stderr, "jsonrpc_stop_all called!\n"); abort(); } +/* Generated stub for jsonrpc_stop_listening */ +void jsonrpc_stop_listening(struct jsonrpc *jsonrpc UNNEEDED) +{ fprintf(stderr, "jsonrpc_stop_listening called!\n"); abort(); } /* Generated stub for load_channels_from_wallet */ struct htlc_in_map *load_channels_from_wallet(struct lightningd *ld UNNEEDED) { fprintf(stderr, "load_channels_from_wallet called!\n"); abort(); } diff --git a/plugins/libplugin.c b/plugins/libplugin.c index 87bafe965e90..d9182c281948 100644 --- a/plugins/libplugin.c +++ b/plugins/libplugin.c @@ -617,6 +617,16 @@ bool rpc_scan_datastore_hex(struct plugin *plugin, return ret; } +static struct command_result *datastore_fail(struct command *command, + const char *buf, + const jsmntok_t *result, + void *unused) +{ + plugin_err(command->plugin, "datastore failed: %.*s", + json_tok_full_len(result), + json_tok_full(buf, result)); +} + struct command_result *jsonrpc_set_datastore_(struct plugin *plugin, struct command *cmd, const char *path, @@ -635,6 +645,11 @@ struct command_result *jsonrpc_set_datastore_(struct plugin *plugin, { struct out_req *req; + if (!cb) + cb = ignore_cb; + if (!errcb) + errcb = datastore_fail; + req = jsonrpc_request_start(plugin, cmd, "datastore", cb, errcb, arg); json_add_keypath(req->js->jout, "key", path); diff --git a/plugins/libplugin.h b/plugins/libplugin.h index d0e9336f5f16..c90a680c7d10 100644 --- a/plugins/libplugin.h +++ b/plugins/libplugin.h @@ -161,7 +161,9 @@ struct json_stream *jsonrpc_stream_fail_data(struct command *cmd, int code, const char *err); -/* Helper to jsonrpc_request_start() and send_outreq() to update datastore. */ +/* Helper to jsonrpc_request_start() and send_outreq() to update datastore. + * NULL cb means ignore, NULL errcb means plugin_error. +*/ struct command_result *jsonrpc_set_datastore_(struct plugin *plugin, struct command *cmd, const char *path, diff --git a/tests/test_closing.py b/tests/test_closing.py index e2cf90dac9f0..db67b5f5095a 100644 --- a/tests/test_closing.py +++ b/tests/test_closing.py @@ -3390,7 +3390,7 @@ def test_closing_higherfee(node_factory, bitcoind, executor): l1.daemon.wait_for_log(r'deriving max fee from rate 30000 -> 16440sat \(not 1000000sat\)') # This will fail because l1 restarted! - with pytest.raises(RpcError, match=r'Channel forgotten before proper close.'): + with pytest.raises(RpcError, match=r'Connection to RPC server lost.'): fut.result(TIMEOUT) # But we still complete negotiation! diff --git a/tests/test_plugin.py b/tests/test_plugin.py index 55f39f9c6312..d9f7ad9ac3dc 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -2542,7 +2542,7 @@ def test_plugin_shutdown(node_factory): l1.rpc.plugin_start(p, dont_shutdown=True) l1.rpc.stop() l1.daemon.wait_for_logs(['test_libplugin: shutdown called', - 'misc_notifications.py: via lightningd shutdown, datastore failed', + 'misc_notifications.py: .* Connection refused', 'test_libplugin: failed to self-terminate in time, killing.']) diff --git a/tools/fromschema.py b/tools/fromschema.py index b5cbc91000b3..e6c4b9c6d70d 100755 --- a/tools/fromschema.py +++ b/tools/fromschema.py @@ -30,13 +30,9 @@ def output(line): def output_type(properties, is_optional): - # FIXME: there's a horrible hack for listpeers' closer which can be NULL - if type(properties['type']) is list: - typename = properties['type'][0] - else: - typename = properties['type'] + typename = properties['type'].replace('_', '\\_') if typename == 'array': - typename += ' of {}s'.format(properties['items']['type']) + typename += ' of {}s'.format(properties['items']['type'].replace('_', '\\_')) if is_optional: typename += ", optional" output(" ({})".format(typename)) diff --git a/tools/test/Makefile b/tools/test/Makefile index c39d3ba0a01d..59380b2ebc01 100644 --- a/tools/test/Makefile +++ b/tools/test/Makefile @@ -33,19 +33,14 @@ TOOL_TEST_COMMON_OBJS := \ TOOLS_WIRE_DEPS := $(BOLT_DEPS) tools/test/test_cases $(wildcard tools/gen/*_template) $(TOOL_TEST_OBJS) $(TOOL_GEN_OBJS): $(TOOL_GEN_HEADER) -$(TOOL_TEST_PROGRAMS): $(TOOL_TEST_COMMON_OBJS) $(TOOL_GEN_SRC:.c=.o) tools/test/enum.o +$(TOOL_TEST_PROGRAMS): $(TOOL_TEST_COMMON_OBJS) $(TOOL_GEN_OBJS) tools/test/enum.o tools/test/test_gen.h: $(TOOLS_WIRE_DEPS) tools/test/Makefile $(BOLT_GEN) --page header $@ test_type < tools/test/test_cases > $@ -.INTERMEDIATE: tools/test/test_gen.c.tmp.c -# Parallel make sometimes tries to use file before update-mocks, so split. -tools/test/test_gen.c.tmp.c: $(TOOLS_WIRE_DEPS) +tools/test/test_gen.c: $(TOOLS_WIRE_DEPS) tools/test/Makefile $(BOLT_GEN) --page impl tools/test/test_gen.h test_type < tools/test/test_cases > $@ -tools/test/test_gen.c: tools/test/test_gen.c.tmp.c $(EXTERNAL_HEADERS) tools/test/test_gen.h $(CCAN_HEADERS) - @MAKE=$(MAKE) tools/update-mocks.sh "$<" $(SUPPRESS_OUTPUT) && mv "$<" "$@" - tools/test/print_gen.h: wire/onion$(EXP)_wiregen.h $(TOOLS_WIRE_DEPS) $(BOLT_GEN) -P --page header $@ test_type < tools/test/test_cases > $@ diff --git a/tools/test/run-test-wire.c b/tools/test/run-test-wire.c index 3e447a7eb4e3..a165cd65c26b 100644 --- a/tools/test/run-test-wire.c +++ b/tools/test/run-test-wire.c @@ -7,9 +7,42 @@ /* AUTOGENERATED MOCKS START */ +/* Generated stub for fromwire_amount_msat */ +struct amount_msat fromwire_amount_msat(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) +{ fprintf(stderr, "fromwire_amount_msat called!\n"); abort(); } +/* Generated stub for fromwire_bool */ +bool fromwire_bool(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) +{ fprintf(stderr, "fromwire_bool called!\n"); abort(); } /* Generated stub for fromwire_peektype */ int fromwire_peektype(const u8 *cursor UNNEEDED) { fprintf(stderr, "fromwire_peektype called!\n"); abort(); } +/* Generated stub for fromwire_tlv */ +bool fromwire_tlv(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, + const struct tlv_record_type *types UNNEEDED, size_t num_types UNNEEDED, + void *record UNNEEDED, struct tlv_field **fields UNNEEDED, + const u64 *extra_types UNNEEDED, size_t *err_off UNNEEDED, u64 *err_type UNNEEDED) +{ fprintf(stderr, "fromwire_tlv called!\n"); abort(); } +/* Generated stub for fromwire_tu32 */ +u32 fromwire_tu32(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) +{ fprintf(stderr, "fromwire_tu32 called!\n"); abort(); } +/* Generated stub for fromwire_tu64 */ +u64 fromwire_tu64(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) +{ fprintf(stderr, "fromwire_tu64 called!\n"); abort(); } +/* Generated stub for fromwire_u16 */ +u16 fromwire_u16(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) +{ fprintf(stderr, "fromwire_u16 called!\n"); abort(); } +/* Generated stub for fromwire_u32 */ +u32 fromwire_u32(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) +{ fprintf(stderr, "fromwire_u32 called!\n"); abort(); } +/* Generated stub for fromwire_u64 */ +u64 fromwire_u64(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) +{ fprintf(stderr, "fromwire_u64 called!\n"); abort(); } +/* Generated stub for fromwire_u8 */ +u8 fromwire_u8(const u8 **cursor UNNEEDED, size_t *max UNNEEDED) +{ fprintf(stderr, "fromwire_u8 called!\n"); abort(); } +/* Generated stub for fromwire_u8_array */ +void fromwire_u8_array(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, u8 *arr UNNEEDED, size_t num UNNEEDED) +{ fprintf(stderr, "fromwire_u8_array called!\n"); abort(); } /* Generated stub for printwire_amount_msat */ bool printwire_amount_msat(const char *fieldname UNNEEDED, const u8 **cursor UNNEEDED, size_t *plen UNNEEDED) { fprintf(stderr, "printwire_amount_msat called!\n"); abort(); } @@ -35,6 +68,38 @@ bool printwire_u64(const char *fieldname UNNEEDED, const u8 **cursor UNNEEDED, s /* Generated stub for printwire_u8_array */ bool printwire_u8_array(const char *fieldname UNNEEDED, const u8 **cursor UNNEEDED, size_t *plen UNNEEDED, size_t len UNNEEDED) { fprintf(stderr, "printwire_u8_array called!\n"); abort(); } +/* Generated stub for towire_amount_msat */ +void towire_amount_msat(u8 **pptr UNNEEDED, const struct amount_msat msat UNNEEDED) +{ fprintf(stderr, "towire_amount_msat called!\n"); abort(); } +/* Generated stub for towire_bool */ +void towire_bool(u8 **pptr UNNEEDED, bool v UNNEEDED) +{ fprintf(stderr, "towire_bool called!\n"); abort(); } +/* Generated stub for towire_tlv */ +void towire_tlv(u8 **pptr UNNEEDED, + const struct tlv_record_type *types UNNEEDED, size_t num_types UNNEEDED, + const void *record UNNEEDED) +{ fprintf(stderr, "towire_tlv called!\n"); abort(); } +/* Generated stub for towire_tu32 */ +void towire_tu32(u8 **pptr UNNEEDED, u32 v UNNEEDED) +{ fprintf(stderr, "towire_tu32 called!\n"); abort(); } +/* Generated stub for towire_tu64 */ +void towire_tu64(u8 **pptr UNNEEDED, u64 v UNNEEDED) +{ fprintf(stderr, "towire_tu64 called!\n"); abort(); } +/* Generated stub for towire_u16 */ +void towire_u16(u8 **pptr UNNEEDED, u16 v UNNEEDED) +{ fprintf(stderr, "towire_u16 called!\n"); abort(); } +/* Generated stub for towire_u32 */ +void towire_u32(u8 **pptr UNNEEDED, u32 v UNNEEDED) +{ fprintf(stderr, "towire_u32 called!\n"); abort(); } +/* Generated stub for towire_u64 */ +void towire_u64(u8 **pptr UNNEEDED, u64 v UNNEEDED) +{ fprintf(stderr, "towire_u64 called!\n"); abort(); } +/* Generated stub for towire_u8 */ +void towire_u8(u8 **pptr UNNEEDED, u8 v UNNEEDED) +{ fprintf(stderr, "towire_u8 called!\n"); abort(); } +/* Generated stub for towire_u8_array */ +void towire_u8_array(u8 **pptr UNNEEDED, const u8 *arr UNNEEDED, size_t num UNNEEDED) +{ fprintf(stderr, "towire_u8_array called!\n"); abort(); } /* AUTOGENERATED MOCKS END */ int main(void) diff --git a/wallet/db.c b/wallet/db.c index 41010d84d3cb..a0fd0e8da786 100644 --- a/wallet/db.c +++ b/wallet/db.c @@ -950,10 +950,10 @@ struct db *db_setup(const tal_t *ctx, struct lightningd *ld, db->report_changes_fn = plugin_hook_db_sync; db_begin_transaction(db); + db->data_version = db_data_version_get(db); migrated = db_migrate(ld, db, bip32_base); - db->data_version = db_data_version_get(db); db_commit_transaction(db); /* This needs to be done outside a transaction, apparently. diff --git a/wallet/test/run-db.c b/wallet/test/run-db.c index 054ddc31d3b3..5059d7ae1923 100644 --- a/wallet/test/run-db.c +++ b/wallet/test/run-db.c @@ -201,17 +201,22 @@ static bool test_manip_columns(void) CHECK_MSG(db_exec_prepared_v2(stmt), "db_exec_prepared must succeed"); CHECK_MSG(!db_err, "Simple correct SQL command"); tal_free(stmt); - /* Don't let it try to set a version field (we don't have one!) */ - db->dirty = false; - db->changes = tal_arr(db, const char *, 0); - db_commit_transaction(db); + + /* Needs vars table, since this changes db. */ + stmt = db_prepare_v2(db, SQL("CREATE TABLE vars (name VARCHAR(32), intval);")); + CHECK_MSG(db_exec_prepared_v2(stmt), "db_exec_prepared must succeed"); + CHECK_MSG(!db_err, "Simple correct SQL command"); + tal_free(stmt); + stmt = db_prepare_v2(db, SQL("INSERT INTO vars VALUES ('data_version', 0);")); + CHECK_MSG(db_exec_prepared_v2(stmt), "db_exec_prepared must succeed"); + CHECK_MSG(!db_err, "Simple correct SQL command"); + tal_free(stmt); /* Rename tablea.field1 -> table1.field1a. */ CHECK(db->config->rename_column(db, "tablea", "field1", "field1a")); /* Remove tableb.field1. */ CHECK(db->config->delete_columns(db, "tableb", &field1, 1)); - db_begin_transaction(db); stmt = db_prepare_v2(db, SQL("SELECT id, field1a FROM tablea;")); CHECK_MSG(db_query_prepared(stmt), "db_query_prepared must succeed"); CHECK_MSG(!db_err, "Simple correct SQL command"); diff --git a/wire/towire.c b/wire/towire.c index 6b104dd603d8..c4bfc64478c3 100644 --- a/wire/towire.c +++ b/wire/towire.c @@ -11,7 +11,9 @@ void towire(u8 **pptr, const void *data, size_t len) size_t oldsize = tal_count(*pptr); tal_resize(pptr, oldsize + len); - memcpy(*pptr + oldsize, memcheck(data, len), len); + /* The C standards committee has a lot to answer for :( */ + if (len) + memcpy(*pptr + oldsize, memcheck(data, len), len); } void towire_u8(u8 **pptr, u8 v)