diff --git a/lightningd/peer_control.c b/lightningd/peer_control.c index 97c1cb56f..f3df54078 100644 --- a/lightningd/peer_control.c +++ b/lightningd/peer_control.c @@ -890,7 +890,6 @@ static void json_getpeers(struct command *cmd, json_array_start(response, "peers"); list_for_each(&cmd->ld->peers, p, list) { json_object_start(response, NULL); - json_add_u64(response, "unique_id", p->unique_id); json_add_string(response, "state", peer_state_name(p->state)); json_add_string(response, "netaddr", netaddr_name(response, &p->netaddr)); diff --git a/lightningd/peer_control.h b/lightningd/peer_control.h index f2dc67258..f89d4a83d 100644 --- a/lightningd/peer_control.h +++ b/lightningd/peer_control.h @@ -23,9 +23,6 @@ struct peer { /* Database ID of the peer */ u64 dbid; - /* Unique ID of connection (works even if we have multiple to same id) */ - u64 unique_id; - /* ID of peer */ struct pubkey id; diff --git a/wallet/db.c b/wallet/db.c index efb850704..f7c5f5ffa 100644 --- a/wallet/db.c +++ b/wallet/db.c @@ -38,7 +38,6 @@ char *dbmigrations[] = { PRIMARY KEY (shachain_id, pos));", "CREATE TABLE channels (" " id INTEGER," /* chan->id */ - " unique_id INTEGER," " peer_id INTEGER REFERENCES peers(id) ON DELETE CASCADE," " short_channel_id BLOB," " channel_config_local INTEGER," diff --git a/wallet/wallet.c b/wallet/wallet.c index b05fdb176..247c3195a 100644 --- a/wallet/wallet.c +++ b/wallet/wallet.c @@ -445,7 +445,6 @@ static bool wallet_stmt2channel(struct wallet *w, sqlite3_stmt *stmt, chan->peer = talz(chan, struct peer); } chan->id = sqlite3_column_int64(stmt, col++); - chan->peer->unique_id = sqlite3_column_int64(stmt, col++); chan->peer->dbid = sqlite3_column_int64(stmt, col++); wallet_peer_load(w, chan->peer->dbid, chan->peer); @@ -549,7 +548,7 @@ static bool wallet_stmt2channel(struct wallet *w, sqlite3_stmt *stmt, col += 2; } - assert(col == 33); + assert(col == 32); chan->peer->channel = chan; @@ -559,7 +558,7 @@ static bool wallet_stmt2channel(struct wallet *w, sqlite3_stmt *stmt, /* List of fields to retrieve from the channels DB table, in the order * that wallet_stmt2channel understands and will parse correctly */ const char *channel_fields = - "id, unique_id, peer_id, short_channel_id, channel_config_local, " + "id, peer_id, short_channel_id, channel_config_local, " "channel_config_remote, state, funder, channel_flags, " "minimum_depth, " "next_index_local, next_index_remote, " @@ -723,7 +722,6 @@ bool wallet_channel_save(struct wallet *w, struct wallet_channel *chan){ /* Now do the real update */ ok &= db_exec(__func__, w->db, "UPDATE channels SET" - " unique_id=%"PRIu64"," " shachain_remote_id=%"PRIu64"," " short_channel_id=%s," " state=%d," @@ -744,7 +742,6 @@ bool wallet_channel_save(struct wallet *w, struct wallet_channel *chan){ " channel_config_local=%"PRIu64"," " last_tx=%s, last_sig=%s" " WHERE id=%"PRIu64, - p->unique_id, p->their_shachain.id, p->scid?tal_fmt(tmpctx,"'%s'", short_channel_id_to_str(tmpctx, p->scid)):"null", p->state, diff --git a/wallet/wallet_tests.c b/wallet/wallet_tests.c index a6c05086d..709a0d073 100644 --- a/wallet/wallet_tests.c +++ b/wallet/wallet_tests.c @@ -212,7 +212,6 @@ static bool test_channel_crud(const tal_t *ctx) memset(&p.id, 'A', sizeof(p.id)); c1.peer = &p; p.id = pk; - p.unique_id = 42; p.our_msatoshi = NULL; p.last_tx = NULL; memset(&ci.their_config, 0, sizeof(struct channel_config));