discovery+graph: convert errors from codes to variables

In preparation for moving funding transaction validiation from the
Builder to the Gossiper in later commit, we first convert these graph
Error Codes to normal error variables. This will help make the later
commit a pure code move.
This commit is contained in:
Elle Mouton
2025-01-30 12:59:43 +02:00
parent 3c0350e481
commit b117daaa3c
5 changed files with 49 additions and 59 deletions

View File

@@ -2678,10 +2678,9 @@ func (d *AuthenticatedGossiper) handleChanAnnouncement(nMsg *networkMsg,
return anns, true
case graph.IsError(
err, graph.ErrNoFundingTransaction,
graph.ErrInvalidFundingOutput,
):
case errors.Is(err, graph.ErrNoFundingTransaction),
errors.Is(err, graph.ErrInvalidFundingOutput):
key := newRejectCacheKey(
scid.ToUint64(),
sourceToPub(nMsg.source),
@@ -2695,7 +2694,7 @@ func (d *AuthenticatedGossiper) handleChanAnnouncement(nMsg *networkMsg,
d.banman.incrementBanScore(nMsg.peer.PubKey())
}
case graph.IsError(err, graph.ErrChannelSpent):
case errors.Is(err, graph.ErrChannelSpent):
key := newRejectCacheKey(
scid.ToUint64(),
sourceToPub(nMsg.source),