From ec014be2a8c0c4ecec7804319d54720b63699270 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Sat, 3 Mar 2018 22:25:05 +0100 Subject: [PATCH] db: Add utxoset table Signed-off-by: Christian Decker --- wallet/db.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/wallet/db.c b/wallet/db.c index f113421e5..eb41dee05 100644 --- a/wallet/db.c +++ b/wallet/db.c @@ -217,6 +217,16 @@ char *dbmigrations[] = { "ALTER TABLE outputs ADD COLUMN spend_height INTEGER REFERENCES blocks(height) ON DELETE SET NULL;", /* Create a covering index that covers both fields */ "CREATE INDEX output_height_idx ON outputs (confirmation_height, spend_height);", + "CREATE TABLE utxoset (" + " txid BLOB," + " outnum INT," + " blockheight INT REFERENCES blocks(height) ON DELETE CASCADE," + " spendheight INT REFERENCES blocks(height) ON DELETE SET NULL," + " txindex INT," + " scriptpubkey BLOB," + " satoshis BIGINT," + " PRIMARY KEY(txid, outnum));", + "CREATE INDEX short_channel_id ON utxoset (blockheight, txindex, outnum)", NULL, };