routing: properly assign flags and write both edges when parsing test data

This commit is contained in:
Olaoluwa Osuntokun 2017-10-18 21:29:14 -07:00
parent 4ff66efa2b
commit e70031da7b
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21

@ -257,12 +257,14 @@ func parseTestGraph(path string) (*channeldb.ChannelGraph, func(), aliasMap, err
ChannelPoint: fundingPoint,
Capacity: btcutil.Amount(edge.Capacity),
}
if err := graph.AddChannelEdge(&edgeInfo); err != nil {
err = graph.AddChannelEdge(&edgeInfo)
if err != nil && err != channeldb.ErrEdgeAlreadyExist {
return nil, nil, nil, err
}
edgePolicy := &channeldb.ChannelEdgePolicy{
Signature: testSig,
Flags: edge.Flags,
ChannelID: edge.ChannelID,
LastUpdate: time.Now(),
TimeLockDelta: edge.Expiry,