mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-10 17:44:22 +01:00
db: Add utxoset table
Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
10
wallet/db.c
10
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,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user