From fea03dbca901f920ab74da18d5693a66ddd71482 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Thu, 15 Feb 2018 17:16:30 +0100 Subject: [PATCH] db: Add a table to track blockheaders Signed-off-by: Christian Decker --- wallet/db.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wallet/db.c b/wallet/db.c index d3e815447..cec29a063 100644 --- a/wallet/db.c +++ b/wallet/db.c @@ -202,6 +202,10 @@ char *dbmigrations[] = { "UPDATE channels SET STATE = 8 WHERE state > 8;", /* Add bolt11 to invoices table*/ "ALTER TABLE invoices ADD bolt11 TEXT;", + /* What do we think the head of the blockchain looks like? Used + * primarily to track confirmations across restarts and making + * sure we handle reorgs correctly. */ + "CREATE TABLE blocks (height INT, hash BLOB, prev_hash BLOB, UNIQUE(height));", NULL, };