Browse Source

db: Add utxoset table

Signed-off-by: Christian Decker <decker.christian@gmail.com>
ppa-0.6.1
Christian Decker 7 years ago
parent
commit
ec014be2a8
  1. 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,
};

Loading…
Cancel
Save