mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-10 07:42:39 +02:00
routing: return ErrRejected if found in reject cache
We make sure to return an error other than ErrIgnored, as ErrIgnored is expected to only be returned for updates where we already have the necessary information in the database. In case of a channel ID found in the rejectCache, there was a possibility that we had rejected an invalid update for this channel earlier, and when attempting to add the current update we wouldn't distinguish the failure to add from an outdated/ignored update.
This commit is contained in:
@@ -946,7 +946,7 @@ func (r *ChannelRouter) processUpdate(msg interface{}) error {
|
||||
r.rejectMtx.RLock()
|
||||
if _, ok := r.rejectCache[msg.ChannelID]; ok {
|
||||
r.rejectMtx.RUnlock()
|
||||
return newErrf(ErrIgnored, "recently rejected "+
|
||||
return newErrf(ErrRejected, "recently rejected "+
|
||||
"chan_id=%v", msg.ChannelID)
|
||||
}
|
||||
r.rejectMtx.RUnlock()
|
||||
@@ -1055,7 +1055,7 @@ func (r *ChannelRouter) processUpdate(msg interface{}) error {
|
||||
r.rejectMtx.RLock()
|
||||
if _, ok := r.rejectCache[msg.ChannelID]; ok {
|
||||
r.rejectMtx.RUnlock()
|
||||
return newErrf(ErrIgnored, "recently rejected "+
|
||||
return newErrf(ErrRejected, "recently rejected "+
|
||||
"chan_id=%v", msg.ChannelID)
|
||||
}
|
||||
r.rejectMtx.RUnlock()
|
||||
|
Reference in New Issue
Block a user