mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
loopdb: provide function NewSqlWriteOpts
It returns transaction options resulting in full (read+write) tx. Use it in loopdb and instantout stores.
This commit is contained in:
parent
174a6b888b
commit
3fd3fab8d1
4 changed files with 20 additions and 12 deletions
|
|
@ -323,7 +323,7 @@ type SqliteTxOptions struct {
|
|||
readOnly bool
|
||||
}
|
||||
|
||||
// NewSqlReadOpts returns a new KeyStoreTxOptions instance triggers a read
|
||||
// NewSqlReadOpts returns a new KeyStoreTxOptions instance that triggers a read
|
||||
// transaction.
|
||||
func NewSqlReadOpts() *SqliteTxOptions {
|
||||
return &SqliteTxOptions{
|
||||
|
|
@ -331,6 +331,14 @@ func NewSqlReadOpts() *SqliteTxOptions {
|
|||
}
|
||||
}
|
||||
|
||||
// NewSqlWriteOpts returns a new KeyStoreTxOptions instance that triggers a
|
||||
// write (regular) transaction.
|
||||
func NewSqlWriteOpts() *SqliteTxOptions {
|
||||
return &SqliteTxOptions{
|
||||
readOnly: false,
|
||||
}
|
||||
}
|
||||
|
||||
// ReadOnly returns true if the transaction should be read only.
|
||||
//
|
||||
// NOTE: This implements the TxOptions interface.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue