mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-22 14:22:37 +01:00
routing: modify applyChannelUpdate to not error out if update is stale
In this commit we fix a slight bug within the existing SendPayment loop which would cause the wrong error to be returned to users. Prior to this commit, if we received an update identical to what we were already aware of, then that error would be returned rather than the ForwardingError that encapsulated this update. In this commit with remedy this by properly returning the exact error. Partially fixes #391.
This commit is contained in:
parent
3e64ba0394
commit
176fde4ec0
1 changed files with 3 additions and 3 deletions
|
@ -805,7 +805,7 @@ func (r *ChannelRouter) processUpdate(msg interface{}) error {
|
|||
case 0:
|
||||
if edge1Timestamp.After(msg.LastUpdate) ||
|
||||
edge1Timestamp.Equal(msg.LastUpdate) {
|
||||
return newErrf(ErrIgnored, "Ignoring announcement "+
|
||||
return newErrf(ErrIgnored, "Ignoring update "+
|
||||
"(flags=%v) for known chan_id=%v", msg.Flags,
|
||||
msg.ChannelID)
|
||||
|
||||
|
@ -817,7 +817,7 @@ func (r *ChannelRouter) processUpdate(msg interface{}) error {
|
|||
if edge2Timestamp.After(msg.LastUpdate) ||
|
||||
edge2Timestamp.Equal(msg.LastUpdate) {
|
||||
|
||||
return newErrf(ErrIgnored, "Ignoring announcement "+
|
||||
return newErrf(ErrIgnored, "Ignoring update "+
|
||||
"(flags=%v) for known chan_id=%v", msg.Flags,
|
||||
msg.ChannelID)
|
||||
}
|
||||
|
@ -1477,7 +1477,7 @@ func (r *ChannelRouter) applyChannelUpdate(msg *lnwire.ChannelUpdate) error {
|
|||
FeeBaseMSat: lnwire.MilliSatoshi(msg.BaseFee),
|
||||
FeeProportionalMillionths: lnwire.MilliSatoshi(msg.FeeRate),
|
||||
})
|
||||
if err != nil {
|
||||
if err != nil && !IsError(err, ErrIgnored) {
|
||||
return fmt.Errorf("Unable to apply channel update: %v", err)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue