@@ -33,10 +33,11 @@ func (c *mockChainNotifier) RawClientWithMacAuth(
33
33
34
34
// SpendRegistration contains registration details.
35
35
type SpendRegistration struct {
36
- Outpoint * wire.OutPoint
37
- PkScript []byte
38
- HeightHint int32
39
- ErrChan chan <- error
36
+ Outpoint * wire.OutPoint
37
+ PkScript []byte
38
+ HeightHint int32
39
+ SpendChannel chan <- * chainntnfs.SpendDetail
40
+ ErrChan chan <- error
40
41
}
41
42
42
43
// ConfRegistration contains registration details.
@@ -53,13 +54,15 @@ func (c *mockChainNotifier) RegisterSpendNtfn(ctx context.Context,
53
54
outpoint * wire.OutPoint , pkScript []byte , heightHint int32 ) (
54
55
chan * chainntnfs.SpendDetail , chan error , error ) {
55
56
57
+ spendChan0 := make (chan * chainntnfs.SpendDetail )
56
58
spendErrChan := make (chan error , 1 )
57
59
58
60
reg := & SpendRegistration {
59
- HeightHint : heightHint ,
60
- Outpoint : outpoint ,
61
- PkScript : pkScript ,
62
- ErrChan : spendErrChan ,
61
+ HeightHint : heightHint ,
62
+ Outpoint : outpoint ,
63
+ PkScript : pkScript ,
64
+ SpendChannel : spendChan0 ,
65
+ ErrChan : spendErrChan ,
63
66
}
64
67
65
68
c .lnd .RegisterSpendChannel <- reg
@@ -78,6 +81,12 @@ func (c *mockChainNotifier) RegisterSpendNtfn(ctx context.Context,
78
81
case <- ctx .Done ():
79
82
}
80
83
84
+ case m := <- spendChan0 :
85
+ select {
86
+ case spendChan <- m :
87
+ case <- ctx .Done ():
88
+ }
89
+
81
90
case err := <- spendErrChan :
82
91
select {
83
92
case errChan <- err :
0 commit comments