2
0
mirror of https://github.com/lightninglabs/loop synced 2024-11-08 01:10:29 +00:00
Commit Graph

27 Commits

Author SHA1 Message Date
Andras Banki-Horvath
c650cdc8a8
loopdb: add ability to track manual migrations 2024-06-03 14:54:18 +02:00
Andras Banki-Horvath
4f5c806ba5
loopdb: add helper methods to update swap costs
This commit adds the necessary sqlc code and SwapStore function to
update swap costs for all swaps in one transaction.
2024-06-03 14:54:18 +02:00
George Tsagkarelis
99608ad515
loopdb+sweepbatcher: add sweepbatcher store 2024-01-23 20:38:06 +02:00
bitcoin-lightning
aefabfaeed
fix typo in store.go 2024-01-02 13:04:21 +08:00
sputn1ck
5d9d7c5c6e
loopdb: add batch insert
This commit adds a batch insert to the interface. This greatly reduces
the time the migration will take. It is not implemented for the boltdb, as
we will not be supporting migrating to the boltdb.
2023-06-20 14:06:05 +02:00
sputn1ck
becc8a38d8
multi: use context in loopdb call
This commit adds a context to our loopdb interface, which we should use
in the sqlite migration.
2023-06-19 12:28:32 +02:00
Andras Banki-Horvath
da4bcbea10
loopdb: refactor the SwapContract to hold all HTLC keys
This commit adds a new struct to hold all HTLC keys and refactors the
SwapContract which is used by both loopin and loopout swaps to use this
new struct. The newly added internal keys will for now hold the script
keys to keep everything equivalent but are already stored and read back
if the protocol version is set to MuSig2.
2023-03-20 20:08:43 +01:00
George Tsagkarelis
4f20239dbb
loopdb: extend store methods for fetching single swap 2023-03-09 00:43:06 +02:00
Andras Banki-Horvath
a252e2c706
loopdb: add the local pubkey's keylocator to the persisted contract 2022-06-30 16:59:57 +02:00
yyforyongyu
26edd21889
loopdb: add new bucket to save liquidity params
This commit adds a new bucket to save liquidity parameters. We've
skipped the serialization and deserialization implementations here and
leave them to be handled by the liquidity package.
2022-06-07 19:19:53 +08:00
Oliver Gugger
39c8c9278d
loopd+loopdb: add timeout to DB open
To make sure we don't just block for forever if another Loop daemon
process is already running, we add a timeout and error out if obtaining
the unique file lock fails after 5 seconds.
2021-04-28 17:16:27 +02:00
Andras Banki-Horvath
86db43a2cb loopdb: store protocol version alongside with swaps
This commit adds the protocol version to each stored swap. This will be
used to ensure that when swaps are resumed after a restart, they're
correctly handled given any breaking protocol changes.
2020-09-09 19:54:01 +02:00
carla
1877b7f08b
multi: store loop out htlc confirmations on disk
To allow users to specify differing confirmation targets, we store the
swap conf target per-swap. This makes us restart safe, so we do not
forget confirmation values for swaps that are in flight when we restart.
2020-08-04 20:28:06 +02:00
carla
9678c7817d
multi: add swap label to SwapContract and store under separate key
This commits adds an optional label to our swaps, and writes it to
disk under a separate key in our swap bucket. This approach is chosen
rather than an on-the-fly addition to our existing swap contract field
so that we do not need to deal with EOF checking in the future. To allow
creation of unique internal labels, we add a reserved prefix which can
be used by the daemon to set labels that are distinct from client set
ones.
2020-08-03 10:55:58 +02:00
Joost Jager
4da4738a2d
loopdb: persist htlc tx hash 2020-06-24 15:28:09 +02:00
Joost Jager
12a7b34d88
loopdb: migrate to nested updates structure 2020-06-24 15:28:07 +02:00
Joost Jager
8c544bf2ba
loopdb: store outgoing channel set
Upgrade the database schema to allow for multiple outgoing channels.
This is implemented as an on-the-fly migration leaving the old key in
place.
2020-05-21 11:22:04 +02:00
Joost Jager
503c83c29f
loopdb: unroll shared fetch logic
Split the fetch logic so that it is easier to add loop type-specific
serialization.
2020-05-21 11:21:56 +02:00
Joost Jager
9927139dd3
loopdb: extract update deserialization
Preparation to prevent code duplication in future refactoring.
2020-05-21 11:13:52 +02:00
Joost Jager
ba5577748b
loopdb: unroll shared creation logic
Another step in the separation of loop in and loop out. This prepares
for a new loop out-specific key to be added.
2020-05-21 11:13:50 +02:00
Johan T. Halseth
034cba5b95
loopdb/loopout: add field SwapPublicationDeadline to LoopOutContract
We also add a migration for the new LoopOut DB format.
2019-11-21 18:47:00 +01:00
Joost Jager
24a1b8d642
loopdb: initialize new database with current version 2019-05-20 13:57:15 +02:00
Joost Jager
1b306ad425
loopdb: replace swap state enum by state data object
This commits lays down the foundation in the database for adding more
persistent state data to swaps.
2019-05-20 13:57:09 +02:00
Joost Jager
6a0a9556a0
loopdb: add loop in
This commit adds the required code to persist loop in swaps. It also
introduces the file loop.go to which shared code is moved.

Sharing of contract serialization/deserialization code has been
reverted. The prepay fields do not apply to loop in, but were part of
the shared contract struct. Without also adding a migration, it wouldn't
be possible to keep the shared code.

In general it is probably more flexible to keep the contract
serialization code separated between in and out swaps.
2019-03-28 11:47:38 +01:00
Joost Jager
9a1b60b4be
multi: always supply chain params when decoding addresses 2019-03-26 17:25:51 +01:00
Olaoluwa Osuntokun
94f347e673
multi: finalize rename from uncharge to loop out 2019-03-06 20:34:04 -08:00
Olaoluwa Osuntokun
cdcb9f8345 loopdb: make new loopdb package to house persistent storage 2019-03-06 20:33:27 -08:00