Skip to content

Commit 039b599

Browse files
committed
routing: add more comments to the ControlTower interface
1 parent b16782c commit 039b599

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

routing/control_tower.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ import (
1717
type ControlTower interface {
1818
// InitPayment initializes a new payment with the given payment hash and
1919
// also notifies subscribers of the payment creation.
20+
//
21+
// NOTE: Subscribers should be notified by the new state of the payment.
2022
InitPayment(lntypes.Hash, *paymentsdb.PaymentCreationInfo) error
2123

2224
// DeleteFailedAttempts removes all failed HTLCs from the db. It should
@@ -25,6 +27,8 @@ type ControlTower interface {
2527
DeleteFailedAttempts(lntypes.Hash) error
2628

2729
// RegisterAttempt atomically records the provided HTLCAttemptInfo.
30+
//
31+
// NOTE: Subscribers should be notified by the new state of the payment.
2832
RegisterAttempt(lntypes.Hash, *paymentsdb.HTLCAttemptInfo) error
2933

3034
// SettleAttempt marks the given attempt settled with the preimage. If
@@ -35,10 +39,14 @@ type ControlTower interface {
3539
// error to prevent us from making duplicate payments to the same
3640
// payment hash. The provided preimage is atomically saved to the DB
3741
// for record keeping.
42+
//
43+
// NOTE: Subscribers should be notified by the new state of the payment.
3844
SettleAttempt(lntypes.Hash, uint64, *paymentsdb.HTLCSettleInfo) (
3945
*paymentsdb.HTLCAttempt, error)
4046

4147
// FailAttempt marks the given payment attempt failed.
48+
//
49+
// NOTE: Subscribers should be notified by the new state of the payment.
4250
FailAttempt(lntypes.Hash, uint64, *paymentsdb.HTLCFailInfo) (
4351
*paymentsdb.HTLCAttempt, error)
4452

@@ -52,6 +60,8 @@ type ControlTower interface {
5260
// invoking this method, InitPayment should return nil on its next call
5361
// for this payment hash, allowing the user to make a subsequent
5462
// payment.
63+
//
64+
// NOTE: Subscribers should be notified by the new state of the payment.
5565
FailPayment(lntypes.Hash, paymentsdb.FailureReason) error
5666

5767
// FetchInFlightPayments returns all payments with status InFlight.

0 commit comments

Comments
 (0)