lnwire: remove the Validate method from the Message interface
This commit revues the Validate method from the Message interface as the method is no longer used and is a relic from an older version of the codebase.
This commit is contained in:
21 files changed
-283
No files matched your search
@@ -203,43 +203,3 @@ func (c *SingleFundingRequest) MaxPayloadLength(uint32) uint32 {
|
||||
|
||||
return length
|
||||
}
|
||||
|
||||
// Validate examines each populated field within the SingleFundingRequest for
|
||||
// field sanity. For example, all fields MUST NOT be negative, and all pkScripts
|
||||
// must belong to the allowed set of public key scripts.
|
||||
//
|
||||
// This is part of the lnwire.Message interface.
|
||||
func (c *SingleFundingRequest) Validate() error {
|
||||
// Negative values is are allowed.
|
||||
if c.FeePerKb < 0 {
|
||||
return fmt.Errorf("'MinFeePerKb' cannot be negative")
|
||||
}
|
||||
if c.FundingAmount < 0 {
|
||||
return fmt.Errorf("'FundingAmount' cannot be negative")
|
||||
}
|
||||
|
||||
// The CSV delay MUST be non-zero.
|
||||
if c.CsvDelay == 0 {
|
||||
return fmt.Errorf("commitment transaction must have non-zero" +
|
||||
" CSV delay")
|
||||
}
|
||||
|
||||
// The delivery pkScript must be amongst the supported script
|
||||
// templates.
|
||||
if !isValidPkScript(c.DeliveryPkScript) {
|
||||
// TODO(roasbeef): move into actual error
|
||||
return fmt.Errorf("valid delivery public key scripts MUST " +
|
||||
"be: P2PKH, P2WKH, P2SH, or P2WSH")
|
||||
}
|
||||
|
||||
if c.DustLimit <= 0 {
|
||||
return fmt.Errorf("DustLimit' should be greater than zero")
|
||||
}
|
||||
|
||||
if c.ConfirmationDepth == 0 {
|
||||
return fmt.Errorf("ConfirmationDepth must be non-zero")
|
||||
}
|
||||
|
||||
// We're good!
|
||||
return nil
|
||||
}
|
||||
Reference in new issue
Block a user