mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-06 17:47:01 +02:00
channedb/mp_payment: add Hash to individual HTLCs
For AMP payments the hash used for each HTLC will differ, and we will need to retrive it after a restart. We therefore persist it with each attempt.
This commit is contained in:
@@ -57,8 +57,10 @@ func makeFakeInfo() (*PaymentCreationInfo, *HTLCAttemptInfo) {
|
||||
var preimg lntypes.Preimage
|
||||
copy(preimg[:], rev[:])
|
||||
|
||||
hash := preimg.Hash()
|
||||
|
||||
c := &PaymentCreationInfo{
|
||||
PaymentHash: preimg.Hash(),
|
||||
PaymentHash: hash,
|
||||
Value: 1000,
|
||||
// Use single second precision to avoid false positive test
|
||||
// failures due to the monotonic time component.
|
||||
@@ -71,6 +73,7 @@ func makeFakeInfo() (*PaymentCreationInfo, *HTLCAttemptInfo) {
|
||||
SessionKey: priv,
|
||||
Route: testRoute,
|
||||
AttemptTime: time.Unix(100, 0),
|
||||
Hash: &hash,
|
||||
}
|
||||
return c, a
|
||||
}
|
||||
|
Reference in New Issue
Block a user