@@ -536,15 +536,80 @@ func (d *Daemon) initialize(withMacaroonService bool) error {
536
536
}()
537
537
538
538
var (
539
- reservationManager * reservation.Manager
540
- instantOutManager * instantout.Manager
541
-
542
539
staticAddressManager * address.Manager
543
540
depositManager * deposit.Manager
544
541
withdrawalManager * withdraw.Manager
545
542
staticLoopInManager * loopin.Manager
546
543
)
547
544
545
+ // Static address manager setup.
546
+ staticAddressStore := address .NewSqlStore (baseDb )
547
+ addrCfg := & address.ManagerConfig {
548
+ AddressClient : staticAddressClient ,
549
+ FetchL402 : swapClient .Server .FetchL402 ,
550
+ Store : staticAddressStore ,
551
+ WalletKit : d .lnd .WalletKit ,
552
+ ChainParams : d .lnd .ChainParams ,
553
+ ChainNotifier : d .lnd .ChainNotifier ,
554
+ }
555
+ staticAddressManager = address .NewManager (addrCfg )
556
+
557
+ // Static address deposit manager setup.
558
+ depositStore := deposit .NewSqlStore (baseDb )
559
+ depoCfg := & deposit.ManagerConfig {
560
+ AddressClient : staticAddressClient ,
561
+ AddressManager : staticAddressManager ,
562
+ SwapClient : swapClient ,
563
+ Store : depositStore ,
564
+ WalletKit : d .lnd .WalletKit ,
565
+ ChainParams : d .lnd .ChainParams ,
566
+ ChainNotifier : d .lnd .ChainNotifier ,
567
+ Signer : d .lnd .Signer ,
568
+ }
569
+ depositManager = deposit .NewManager (depoCfg )
570
+
571
+ // Static address deposit withdrawal manager setup.
572
+ withdrawalCfg := & withdraw.ManagerConfig {
573
+ StaticAddressServerClient : staticAddressClient ,
574
+ AddressManager : staticAddressManager ,
575
+ DepositManager : depositManager ,
576
+ WalletKit : d .lnd .WalletKit ,
577
+ ChainParams : d .lnd .ChainParams ,
578
+ ChainNotifier : d .lnd .ChainNotifier ,
579
+ Signer : d .lnd .Signer ,
580
+ }
581
+ withdrawalManager = withdraw .NewManager (withdrawalCfg )
582
+
583
+ // Static address loop-in manager setup.
584
+ staticAddressLoopInStore := loopin .NewSqlStore (
585
+ loopdb.NewTypedStore [loopin.Querier ](baseDb ),
586
+ clock .NewDefaultClock (), d .lnd .ChainParams ,
587
+ )
588
+
589
+ staticLoopInManager = loopin .NewManager (& loopin.Config {
590
+ Server : staticAddressClient ,
591
+ QuoteGetter : swapClient .Server ,
592
+ LndClient : d .lnd .Client ,
593
+ InvoicesClient : d .lnd .Invoices ,
594
+ NodePubkey : d .lnd .NodePubkey ,
595
+ AddressManager : staticAddressManager ,
596
+ DepositManager : depositManager ,
597
+ Store : staticAddressLoopInStore ,
598
+ WalletKit : d .lnd .WalletKit ,
599
+ ChainNotifier : d .lnd .ChainNotifier ,
600
+ NotificationManager : notificationManager ,
601
+ ChainParams : d .lnd .ChainParams ,
602
+ Signer : d .lnd .Signer ,
603
+ ValidateLoopInContract : loop .ValidateLoopInContract ,
604
+ MaxStaticAddrHtlcFeePercentage : d .cfg .MaxStaticAddrHtlcFeePercentage ,
605
+ MaxStaticAddrHtlcBackupFeePercentage : d .cfg .MaxStaticAddrHtlcBackupFeePercentage ,
606
+ })
607
+
608
+ var (
609
+ reservationManager * reservation.Manager
610
+ instantOutManager * instantout.Manager
611
+ )
612
+
548
613
// Create the reservation and instantout managers.
549
614
if d .cfg .EnableExperimental {
550
615
reservationStore := reservation .NewSQLStore (
@@ -583,69 +648,6 @@ func (d *Daemon) initialize(withMacaroonService bool) error {
583
648
instantOutManager = instantout .NewInstantOutManager (
584
649
instantOutConfig ,
585
650
)
586
-
587
- // Static address manager setup.
588
- staticAddressStore := address .NewSqlStore (baseDb )
589
- addrCfg := & address.ManagerConfig {
590
- AddressClient : staticAddressClient ,
591
- FetchL402 : swapClient .Server .FetchL402 ,
592
- Store : staticAddressStore ,
593
- WalletKit : d .lnd .WalletKit ,
594
- ChainParams : d .lnd .ChainParams ,
595
- ChainNotifier : d .lnd .ChainNotifier ,
596
- }
597
- staticAddressManager = address .NewManager (addrCfg )
598
-
599
- // Static address deposit manager setup.
600
- depositStore := deposit .NewSqlStore (baseDb )
601
- depoCfg := & deposit.ManagerConfig {
602
- AddressClient : staticAddressClient ,
603
- AddressManager : staticAddressManager ,
604
- SwapClient : swapClient ,
605
- Store : depositStore ,
606
- WalletKit : d .lnd .WalletKit ,
607
- ChainParams : d .lnd .ChainParams ,
608
- ChainNotifier : d .lnd .ChainNotifier ,
609
- Signer : d .lnd .Signer ,
610
- }
611
- depositManager = deposit .NewManager (depoCfg )
612
-
613
- // Static address deposit withdrawal manager setup.
614
- withdrawalCfg := & withdraw.ManagerConfig {
615
- StaticAddressServerClient : staticAddressClient ,
616
- AddressManager : staticAddressManager ,
617
- DepositManager : depositManager ,
618
- WalletKit : d .lnd .WalletKit ,
619
- ChainParams : d .lnd .ChainParams ,
620
- ChainNotifier : d .lnd .ChainNotifier ,
621
- Signer : d .lnd .Signer ,
622
- }
623
- withdrawalManager = withdraw .NewManager (withdrawalCfg )
624
-
625
- // Static address loop-in manager setup.
626
- staticAddressLoopInStore := loopin .NewSqlStore (
627
- loopdb.NewTypedStore [loopin.Querier ](baseDb ),
628
- clock .NewDefaultClock (), d .lnd .ChainParams ,
629
- )
630
-
631
- staticLoopInManager = loopin .NewManager (& loopin.Config {
632
- Server : staticAddressClient ,
633
- QuoteGetter : swapClient .Server ,
634
- LndClient : d .lnd .Client ,
635
- InvoicesClient : d .lnd .Invoices ,
636
- NodePubkey : d .lnd .NodePubkey ,
637
- AddressManager : staticAddressManager ,
638
- DepositManager : depositManager ,
639
- Store : staticAddressLoopInStore ,
640
- WalletKit : d .lnd .WalletKit ,
641
- ChainNotifier : d .lnd .ChainNotifier ,
642
- NotificationManager : notificationManager ,
643
- ChainParams : d .lnd .ChainParams ,
644
- Signer : d .lnd .Signer ,
645
- ValidateLoopInContract : loop .ValidateLoopInContract ,
646
- MaxStaticAddrHtlcFeePercentage : d .cfg .MaxStaticAddrHtlcFeePercentage ,
647
- MaxStaticAddrHtlcBackupFeePercentage : d .cfg .MaxStaticAddrHtlcBackupFeePercentage ,
648
- })
649
651
}
650
652
651
653
// Now finally fully initialize the swap client RPC server instance.
0 commit comments