routing: add new error for invalid funding tx rejection

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

View File

@ -20,6 +20,10 @@ const (
// the purported funding output has actually already been spent on
// chain.
ErrChannelSpent
// ErrNoFundingTransaction is returned when we are unable to find the
// funding transaction described by the short channel ID on chain.
ErrNoFundingTransaction
)
// routerError is a structure that represent the error inside the routing package,

View File

@ -1309,8 +1309,9 @@ func (r *ChannelRouter) processUpdate(msg interface{},
channelID := lnwire.NewShortChanIDFromInt(msg.ChannelID)
fundingTx, err := r.fetchFundingTx(&channelID)
if err != nil {
return errors.Errorf("unable to fetch funding tx for "+
"chan_id=%v: %v", msg.ChannelID, err)
return newErrf(ErrNoFundingTransaction, "unable to "+
"fetch funding tx for chan_id=%v: %v",
msg.ChannelID, err)
}
// Recreate witness output to be sure that declared in channel