channeldb: rename PaymentAttemptInfo to HTLCAttemptInfo

To better distinguish payments from HTLCs, we rename the attempt info
struct to HTLCAttemptInfo. We also embed it into the HTLCAttempt struct,
to avoid having to duplicate this information.

The paymentID term is renamed to attemptID.
This commit is contained in:
Johan T. Halseth authored and Joost Jager committed 2020-03-09 11:43:26 +01:00
1 parent 967b4b2dc3
commit bee2380441
10 files changed
+75 -88

No files matched your search

+4 -4
View File
@@ -19,8 +19,8 @@ type ControlTower interface {
// hash.
InitPayment(lntypes.Hash, *channeldb.PaymentCreationInfo) error
// RegisterAttempt atomically records the provided PaymentAttemptInfo.
RegisterAttempt(lntypes.Hash, *channeldb.PaymentAttemptInfo) error
// RegisterAttempt atomically records the provided HTLCAttemptInfo.
RegisterAttempt(lntypes.Hash, *channeldb.HTLCAttemptInfo) error
// Success transitions a payment into the Succeeded state. After
// invoking this method, InitPayment should always return an error to
@@ -91,10 +91,10 @@ func (p *controlTower) InitPayment(paymentHash lntypes.Hash,
return p.db.InitPayment(paymentHash, info)
}
// RegisterAttempt atomically records the provided PaymentAttemptInfo to the
// RegisterAttempt atomically records the provided HTLCAttemptInfo to the
// DB.
func (p *controlTower) RegisterAttempt(paymentHash lntypes.Hash,
attempt *channeldb.PaymentAttemptInfo) error {
attempt *channeldb.HTLCAttemptInfo) error {
return p.db.RegisterAttempt(paymentHash, attempt)
}