routing: split launchShard into registerAttempt and sendAttempt
This commit removes the method `launchShard` and splits its original functionality into two steps - first create the attempt, second send the attempt. This enables us to have finer control over "which error is returned from which system and how to handle it".
This commit is contained in:
5 files changed
+146
-194
No files matched your search
@@ -800,6 +800,15 @@ func makeSettledAttempt(total, fee int,
|
||||
}
|
||||
}
|
||||
|
||||
func makeFailedAttempt(total, fee int) *channeldb.HTLCAttempt {
|
||||
return &channeldb.HTLCAttempt{
|
||||
HTLCAttemptInfo: makeAttemptInfo(total, total-fee),
|
||||
Failure: &channeldb.HTLCFailInfo{
|
||||
Reason: channeldb.HTLCFailInternal,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func makeAttemptInfo(total, amtForwarded int) channeldb.HTLCAttemptInfo {
|
||||
hop := &route.Hop{AmtToForward: lnwire.MilliSatoshi(amtForwarded)}
|
||||
return channeldb.HTLCAttemptInfo{
|
||||
|
||||
Reference in new issue
Block a user