@@ -25,9 +25,9 @@ use lightning::util::message_signing;
25
25
use lightning_invoice:: RawBolt11Invoice ;
26
26
27
27
use bdk:: blockchain:: EsploraBlockchain ;
28
- use bdk:: database:: BatchDatabase ;
29
28
use bdk:: wallet:: AddressIndex ;
30
29
use bdk:: { Balance , SignOptions , SyncOptions } ;
30
+ use bdk_wallet:: Wallet as BdkWallet ;
31
31
32
32
use bitcoin:: blockdata:: constants:: WITNESS_SCALE_FACTOR ;
33
33
use bitcoin:: blockdata:: locktime:: absolute:: LockTime ;
@@ -48,17 +48,16 @@ enum WalletSyncStatus {
48
48
InProgress { subscribers : tokio:: sync:: broadcast:: Sender < Result < ( ) , Error > > } ,
49
49
}
50
50
51
- pub ( crate ) struct Wallet < D , B : Deref , E : Deref , L : Deref >
51
+ pub ( crate ) struct Wallet < B : Deref , E : Deref , L : Deref >
52
52
where
53
- D : BatchDatabase ,
54
53
B :: Target : BroadcasterInterface ,
55
54
E :: Target : FeeEstimator ,
56
55
L :: Target : Logger ,
57
56
{
58
57
// A BDK blockchain used for wallet sync.
59
58
blockchain : EsploraBlockchain ,
60
59
// A BDK on-chain wallet.
61
- inner : Mutex < bdk :: Wallet < D > > ,
60
+ inner : Mutex < BdkWallet > ,
62
61
// A cache storing the most recently retrieved fee rate estimations.
63
62
broadcaster : B ,
64
63
fee_estimator : E ,
@@ -69,15 +68,14 @@ where
69
68
logger : L ,
70
69
}
71
70
72
- impl < D , B : Deref , E : Deref , L : Deref > Wallet < D , B , E , L >
71
+ impl < B : Deref , E : Deref , L : Deref > Wallet < B , E , L >
73
72
where
74
- D : BatchDatabase ,
75
73
B :: Target : BroadcasterInterface ,
76
74
E :: Target : FeeEstimator ,
77
75
L :: Target : Logger ,
78
76
{
79
77
pub ( crate ) fn new (
80
- blockchain : EsploraBlockchain , wallet : bdk :: Wallet < D > , broadcaster : B , fee_estimator : E ,
78
+ blockchain : EsploraBlockchain , wallet : BdkWallet , broadcaster : B , fee_estimator : E ,
81
79
logger : L ,
82
80
) -> Self {
83
81
let start_balance = wallet. get_balance ( ) . unwrap_or ( Balance {
@@ -366,9 +364,8 @@ where
366
364
}
367
365
}
368
366
369
- impl < D , B : Deref , E : Deref , L : Deref > WalletSource for Wallet < D , B , E , L >
367
+ impl < B : Deref , E : Deref , L : Deref > WalletSource for Wallet < B , E , L >
370
368
where
371
- D : BatchDatabase ,
372
369
B :: Target : BroadcasterInterface ,
373
370
E :: Target : FeeEstimator ,
374
371
L :: Target : Logger ,
@@ -488,21 +485,19 @@ where
488
485
489
486
/// Similar to [`KeysManager`], but overrides the destination and shutdown scripts so they are
490
487
/// directly spendable by the BDK wallet.
491
- pub ( crate ) struct WalletKeysManager < D , B : Deref , E : Deref , L : Deref >
488
+ pub ( crate ) struct WalletKeysManager < B : Deref , E : Deref , L : Deref >
492
489
where
493
- D : BatchDatabase ,
494
490
B :: Target : BroadcasterInterface ,
495
491
E :: Target : FeeEstimator ,
496
492
L :: Target : Logger ,
497
493
{
498
494
inner : KeysManager ,
499
- wallet : Arc < Wallet < D , B , E , L > > ,
495
+ wallet : Arc < Wallet < B , E , L > > ,
500
496
logger : L ,
501
497
}
502
498
503
- impl < D , B : Deref , E : Deref , L : Deref > WalletKeysManager < D , B , E , L >
499
+ impl < B : Deref , E : Deref , L : Deref > WalletKeysManager < B , E , L >
504
500
where
505
- D : BatchDatabase ,
506
501
B :: Target : BroadcasterInterface ,
507
502
E :: Target : FeeEstimator ,
508
503
L :: Target : Logger ,
@@ -513,7 +508,7 @@ where
513
508
/// `starting_time_nanos`.
514
509
pub fn new (
515
510
seed : & [ u8 ; 32 ] , starting_time_secs : u64 , starting_time_nanos : u32 ,
516
- wallet : Arc < Wallet < D , B , E , L > > , logger : L ,
511
+ wallet : Arc < Wallet < B , E , L > > , logger : L ,
517
512
) -> Self {
518
513
let inner = KeysManager :: new ( seed, starting_time_secs, starting_time_nanos) ;
519
514
Self { inner, wallet, logger }
@@ -532,9 +527,8 @@ where
532
527
}
533
528
}
534
529
535
- impl < D , B : Deref , E : Deref , L : Deref > NodeSigner for WalletKeysManager < D , B , E , L >
530
+ impl < B : Deref , E : Deref , L : Deref > NodeSigner for WalletKeysManager < B , E , L >
536
531
where
537
- D : BatchDatabase ,
538
532
B :: Target : BroadcasterInterface ,
539
533
E :: Target : FeeEstimator ,
540
534
L :: Target : Logger ,
@@ -576,9 +570,8 @@ where
576
570
}
577
571
}
578
572
579
- impl < D , B : Deref , E : Deref , L : Deref > OutputSpender for WalletKeysManager < D , B , E , L >
573
+ impl < B : Deref , E : Deref , L : Deref > OutputSpender for WalletKeysManager < B , E , L >
580
574
where
581
- D : BatchDatabase ,
582
575
B :: Target : BroadcasterInterface ,
583
576
E :: Target : FeeEstimator ,
584
577
L :: Target : Logger ,
@@ -600,9 +593,8 @@ where
600
593
}
601
594
}
602
595
603
- impl < D , B : Deref , E : Deref , L : Deref > EntropySource for WalletKeysManager < D , B , E , L >
596
+ impl < B : Deref , E : Deref , L : Deref > EntropySource for WalletKeysManager < B , E , L >
604
597
where
605
- D : BatchDatabase ,
606
598
B :: Target : BroadcasterInterface ,
607
599
E :: Target : FeeEstimator ,
608
600
L :: Target : Logger ,
@@ -612,9 +604,8 @@ where
612
604
}
613
605
}
614
606
615
- impl < D , B : Deref , E : Deref , L : Deref > SignerProvider for WalletKeysManager < D , B , E , L >
607
+ impl < B : Deref , E : Deref , L : Deref > SignerProvider for WalletKeysManager < B , E , L >
616
608
where
617
- D : BatchDatabase ,
618
609
B :: Target : BroadcasterInterface ,
619
610
E :: Target : FeeEstimator ,
620
611
L :: Target : Logger ,
@@ -664,9 +655,8 @@ where
664
655
}
665
656
}
666
657
667
- impl < D , B : Deref , E : Deref , L : Deref > ChangeDestinationSource for WalletKeysManager < D , B , E , L >
658
+ impl < B : Deref , E : Deref , L : Deref > ChangeDestinationSource for WalletKeysManager < B , E , L >
668
659
where
669
- D : BatchDatabase ,
670
660
B :: Target : BroadcasterInterface ,
671
661
E :: Target : FeeEstimator ,
672
662
L :: Target : Logger ,
0 commit comments