multi: introduce interface for payment database

This commit is contained in:
ziggie
2025-08-12 18:14:09 +02:00
parent 9a4968656a
commit 9f824fe1ee
5 changed files with 103 additions and 14 deletions

View File

@@ -151,7 +151,7 @@ func (s *controlTowerSubscriberImpl) Updates() <-chan interface{} {
// controlTower is persistent implementation of ControlTower to restrict
// double payment sending.
type controlTower struct {
db *paymentsdb.KVPaymentsDB
db paymentsdb.DB
// subscriberIndex is used to provide a unique id for each subscriber
// to all payments. This is used to easily remove the subscriber when
@@ -168,7 +168,7 @@ type controlTower struct {
}
// NewControlTower creates a new instance of the controlTower.
func NewControlTower(db *paymentsdb.KVPaymentsDB) ControlTower {
func NewControlTower(db paymentsdb.DB) ControlTower {
return &controlTower{
db: db,
subscribersAllPayments: make(