From 5a2a044b82507df2bd52cc1a88cae50e26a69d74 Mon Sep 17 00:00:00 2001 From: Chris Gianelloni Date: Thu, 27 Mar 2025 12:53:46 -0400 Subject: [PATCH] fix(database): use writable transactions for utxo writes Signed-off-by: Chris Gianelloni --- database/utxo.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/database/utxo.go b/database/utxo.go index f26b358d..3937267e 100644 --- a/database/utxo.go +++ b/database/utxo.go @@ -147,7 +147,7 @@ func (d *Database) UtxosDeleteConsumed( ) error { var ret error if txn == nil { - txn = d.Transaction(false) + txn = d.Transaction(true) defer txn.Commit() //nolint:errcheck } // Get UTxOs that are marked as deleted and older than our slot window @@ -191,7 +191,7 @@ func (d *Database) UtxosDeleteRolledback( ) error { var ret error if txn == nil { - txn = d.Transaction(false) + txn = d.Transaction(true) defer txn.Commit() //nolint:errcheck } utxos, err := d.metadata.GetUtxosDeletedBeforeSlot(slot, txn.Metadata()) @@ -233,7 +233,7 @@ func (d *Database) UtxosUnspend( txn *Txn, ) error { if txn == nil { - txn = NewMetadataOnlyTxn(d, false) + txn = NewMetadataOnlyTxn(d, true) defer txn.Commit() //nolint:errcheck } return d.metadata.SetUtxosNotDeletedAfterSlot(slot, txn.Metadata())