routing: convert to node pair based

Previously mission control tracked failures on a per node, per channel basis.
This commit changes this to tracking on the level of directed node pairs. The goal
of moving to this coarser-grained level is to reduce the number of required
payment attempts without compromising payment reliability.
This commit is contained in:
Joost Jager
2019-07-29 15:10:58 +02:00
parent 6ee2c04190
commit f1769c8c8c
17 changed files with 1133 additions and 995 deletions

View File

@ -32,24 +32,43 @@ func queryMissionControl(ctx *cli.Context) error {
}
type displayNodeHistory struct {
Pubkey string
LastFailTime int64
OtherChanSuccessProb float32
Channels []*routerrpc.ChannelHistory
Pubkey string
LastFailTime int64
OtherSuccessProb float32
}
type displayPairHistory struct {
NodeFrom, NodeTo string
LastFailTime int64
SuccessProb float32
MinPenalizeAmtSat int64
}
displayResp := struct {
Nodes []displayNodeHistory
Pairs []displayPairHistory
}{}
for _, n := range snapshot.Nodes {
displayResp.Nodes = append(
displayResp.Nodes,
displayNodeHistory{
Pubkey: hex.EncodeToString(n.Pubkey),
LastFailTime: n.LastFailTime,
OtherChanSuccessProb: n.OtherChanSuccessProb,
Channels: n.Channels,
Pubkey: hex.EncodeToString(n.Pubkey),
LastFailTime: n.LastFailTime,
OtherSuccessProb: n.OtherSuccessProb,
},
)
}
for _, n := range snapshot.Pairs {
displayResp.Pairs = append(
displayResp.Pairs,
displayPairHistory{
NodeFrom: hex.EncodeToString(n.NodeFrom),
NodeTo: hex.EncodeToString(n.NodeTo),
LastFailTime: n.LastFailTime,
SuccessProb: n.SuccessProb,
MinPenalizeAmtSat: n.MinPenalizeAmtSat,
},
)
}