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:
5 files changed
+49
-59
No files matched your search
+4
-6
@@ -1314,8 +1314,7 @@ func (b *Builder) addEdge(edge *models.ChannelEdgeInfo,
|
||||
default:
|
||||
}
|
||||
|
||||
return NewErrf(ErrNoFundingTransaction, "unable to "+
|
||||
"locate funding tx: %v", err)
|
||||
return fmt.Errorf("%w: %w", ErrNoFundingTransaction, err)
|
||||
}
|
||||
|
||||
// Recreate witness output to be sure that declared in channel edge
|
||||
@@ -1348,8 +1347,7 @@ func (b *Builder) addEdge(edge *models.ChannelEdgeInfo,
|
||||
return err
|
||||
}
|
||||
|
||||
return NewErrf(ErrInvalidFundingOutput, "output failed "+
|
||||
"validation: %w", err)
|
||||
return fmt.Errorf("%w: %w", ErrInvalidFundingOutput, err)
|
||||
}
|
||||
|
||||
// Now that we have the funding outpoint of the channel, ensure
|
||||
@@ -1366,8 +1364,8 @@ func (b *Builder) addEdge(edge *models.ChannelEdgeInfo,
|
||||
}
|
||||
}
|
||||
|
||||
return NewErrf(ErrChannelSpent, "unable to fetch utxo for "+
|
||||
"chan_id=%v, chan_point=%v: %v", edge.ChannelID,
|
||||
return fmt.Errorf("%w: unable to fetch utxo for chan_id=%v, "+
|
||||
"chan_point=%v: %w", ErrChannelSpent, scid.ToUint64(),
|
||||
fundingPoint, err)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user