From 28feb2eb7dce9b06427b4f46649ee5f0b7708ca3 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Tue, 3 Apr 2018 15:19:00 +0200 Subject: [PATCH] db: Add table for onchaind transactions These transactions being seen on the blockchain triggered some action in onchaind so we need to replay them when we restore the onchaind. Signed-off-by: Christian Decker --- wallet/db.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/wallet/db.c b/wallet/db.c index e5a7275d1..33667e991 100644 --- a/wallet/db.c +++ b/wallet/db.c @@ -306,6 +306,18 @@ char *dbmigrations[] = { " SET faildetail = 'unspecified payment failure reason'" " WHERE status = 2;", /* PAYMENT_FAILED */ /* -- Detailed payment faiure ends -- */ + "CREATE TABLE channeltxs (" + /* The id serves as insertion order and short ID */ + " id INTEGER" + ", channel_id INTEGER REFERENCES channels(id) ON DELETE CASCADE" + ", type INTEGER" + ", transaction_id BLOB REFERENCES transactions(id) ON DELETE CASCADE" + /* The input_num is only used by the txo_watch, 0 if txwatch */ + ", input_num INTEGER" + /* The height at which we sent the depth notice */ + ", blockheight INTEGER REFERENCES blocks(height) ON DELETE CASCADE" + ", PRIMARY KEY(id)" + ");", NULL, };