routing: add new error for spent channel UTXOs

This commit is contained in:
Olaoluwa Osuntokun 2021-04-20 18:22:36 -05:00
parent 7b42ad0b0e
commit 0dc6f8058d
No known key found for this signature in database
GPG Key ID: 3BBD59E99B280306
2 changed files with 7 additions and 1 deletions

@ -15,6 +15,11 @@ const (
// this update can't bring us something new, or because a node // this update can't bring us something new, or because a node
// announcement was given for node not found in any channel. // announcement was given for node not found in any channel.
ErrIgnored ErrIgnored
// ErrChannelSpent is returned when we go to validate a channel, but
// the purported funding output has actually already been spent on
// chain.
ErrChannelSpent
) )
// routerError is a structure that represent the error inside the routing package, // routerError is a structure that represent the error inside the routing package,

@ -1354,7 +1354,8 @@ func (r *ChannelRouter) processUpdate(msg interface{},
r.quit, r.quit,
) )
if err != nil { if err != nil {
return fmt.Errorf("unable to fetch utxo "+
return newErrf(ErrChannelSpent, "unable to fetch utxo "+
"for chan_id=%v, chan_point=%v: %v", "for chan_id=%v, chan_point=%v: %v",
msg.ChannelID, fundingPoint, err) msg.ChannelID, fundingPoint, err)
} }