test: update testUpdateChannelPolicy to ensure Bob's link uses the proper policies

In this commit, we update the testUpdateChannelPolicy to exercise the
recent set of changes within the switch. If one applies this test to a
fresh branch (without those new changes) it should fail. This is due to
the fact that before, Bob would attempt to apply the constraints of the
incoming link (which we updated) instead of the outgoing link. With the
recent set of changes, the test now properly passes.
This commit is contained in:
Olaoluwa Osuntokun
2018-04-03 20:18:42 -07:00
parent ffabb17ce6
commit 3fa2e08665
4 changed files with 74 additions and 41 deletions

View File

@@ -1147,6 +1147,12 @@ func (d *AuthenticatedGossiper) processChanPolicyUpdate(
}
haveChanFilter := len(chansToUpdate) != 0
if haveChanFilter {
log.Infof("Updating routing policies for chan_points=%v",
spew.Sdump(chansToUpdate))
} else {
log.Infof("Updating routing policies for all chans")
}
type edgeWithInfo struct {
info *channeldb.ChannelEdgeInfo
@@ -2145,8 +2151,8 @@ func (d *AuthenticatedGossiper) updateChannel(info *channeldb.ChannelEdgeInfo,
var err error
// Make sure timestamp is always increased, such that our update
// gets propagated.
// Make sure timestamp is always increased, such that our update gets
// propagated.
timestamp := time.Now().Unix()
if timestamp <= edge.LastUpdate.Unix() {
timestamp = edge.LastUpdate.Unix() + 1