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

+3 -3
View File
@@ -298,7 +298,7 @@ func initDB() (*channeldb.DB, error) {
return db, err
}
func genInfo() (*channeldb.PaymentCreationInfo, *channeldb.PaymentAttemptInfo,
func genInfo() (*channeldb.PaymentCreationInfo, *channeldb.HTLCAttemptInfo,
lntypes.Preimage, error) {
preimage, err := genPreimage()
@@ -314,8 +314,8 @@ func genInfo() (*channeldb.PaymentCreationInfo, *channeldb.PaymentAttemptInfo,
CreationTime: time.Unix(time.Now().Unix(), 0),
PaymentRequest: []byte("hola"),
},
&channeldb.PaymentAttemptInfo{
PaymentID: 1,
&channeldb.HTLCAttemptInfo{
AttemptID: 1,
SessionKey: priv,
Route: testRoute,
}, preimage, nil