mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-26 13:42:49 +02:00
routing: embed TimedPairResult in snapshot data
This commit is contained in:
@@ -159,16 +159,8 @@ type MissionControlPairSnapshot struct {
|
||||
// Pair is the node pair of which the state is described.
|
||||
Pair DirectedNodePair
|
||||
|
||||
// Timestamp is the time of last result.
|
||||
Timestamp time.Time
|
||||
|
||||
// MinPenalizeAmt is the minimum amount for which the channel will be
|
||||
// penalized.
|
||||
MinPenalizeAmt lnwire.MilliSatoshi
|
||||
|
||||
// LastAttemptSuccessful indicates whether the last payment attempt
|
||||
// through this pair was successful.
|
||||
LastAttemptSuccessful bool
|
||||
// TimedPairResult contains the data for this pair.
|
||||
TimedPairResult
|
||||
}
|
||||
|
||||
// paymentResult is the information that becomes available when a payment
|
||||
@@ -345,14 +337,11 @@ func (m *MissionControl) GetHistorySnapshot() *MissionControlSnapshot {
|
||||
|
||||
for fromNode, fromPairs := range m.lastPairResult {
|
||||
for toNode, result := range fromPairs {
|
||||
|
||||
pair := NewDirectedNodePair(fromNode, toNode)
|
||||
|
||||
pairSnapshot := MissionControlPairSnapshot{
|
||||
Pair: pair,
|
||||
MinPenalizeAmt: result.MinPenalizeAmt,
|
||||
Timestamp: result.Timestamp,
|
||||
LastAttemptSuccessful: result.Success,
|
||||
Pair: pair,
|
||||
TimedPairResult: result,
|
||||
}
|
||||
|
||||
pairs = append(pairs, pairSnapshot)
|
||||
|
Reference in New Issue
Block a user