adjusted utxo space to resemble outputs

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
This commit is contained in:
Lorenz Herzberger 2023-04-06 17:26:23 +02:00
parent dbf4e9085c
commit b69a217289
No known key found for this signature in database
GPG Key ID: FA5EE906EB55316A

View File

@ -171,9 +171,11 @@ function init()
utxos = box.schema.create_space('utxos', { if_not_exists = true })
utxos:format({
{ name = 'id', type = 'string' },
{ name = 'transaction_id', type = 'string' },
{ name = 'output_index', type = 'unsigned' },
{ name = 'utxo', type = 'map' }
{ name = 'amount' , type = 'unsigned' },
{ name = 'public_keys', type = 'array' },
{ name = 'condition', type = 'map' },
{ name = 'output_index', type = 'number' },
{ name = 'transaction_id' , type = 'string' }
})
utxos:create_index('id', {
if_not_exists = true,
@ -189,7 +191,13 @@ function init()
parts = {
{ field = 'transaction_id', type = 'string' },
{ field = 'output_index', type = 'unsigned' }
}})
}
})
utxos:create_index('utxo_by_public_keys', {
if_not_exists = true,
unique = false,
parts = {{field = 'public_keys[*]', type = 'string' }}
})
-- Elections