Cleanup comments & removed notes on escrow
This commit is contained in:
1 parent
84c0f56330
commit
f2a1c0368a
36 files changed
+648
-769
No files matched your search
+13
-13
@@ -5,19 +5,19 @@ import (
|
||||
"io"
|
||||
)
|
||||
|
||||
//Multiple Clearing Requests are possible by putting this inside an array of
|
||||
//clearing requests
|
||||
// Multiple Clearing Requests are possible by putting this inside an array of
|
||||
// clearing requests
|
||||
type ErrorGeneric struct {
|
||||
//We can use a different data type for this if necessary...
|
||||
// We can use a different data type for this if necessary...
|
||||
ChannelID uint64
|
||||
//Some kind of message
|
||||
//Max length 8192
|
||||
// Some kind of message
|
||||
// Max length 8192
|
||||
Problem string
|
||||
}
|
||||
|
||||
func (c *ErrorGeneric) Decode(r io.Reader, pver uint32) error {
|
||||
//ChannelID(8)
|
||||
//Problem
|
||||
// ChannelID(8)
|
||||
// Problem
|
||||
err := readElements(r,
|
||||
&c.ChannelID,
|
||||
&c.Problem,
|
||||
@@ -29,13 +29,13 @@ func (c *ErrorGeneric) Decode(r io.Reader, pver uint32) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
//Creates a new ErrorGeneric
|
||||
// Creates a new ErrorGeneric
|
||||
func NewErrorGeneric() *ErrorGeneric {
|
||||
return &ErrorGeneric{}
|
||||
}
|
||||
|
||||
//Serializes the item from the ErrorGeneric struct
|
||||
//Writes the data to w
|
||||
// Serializes the item from the ErrorGeneric struct
|
||||
// Writes the data to w
|
||||
func (c *ErrorGeneric) Encode(w io.Writer, pver uint32) error {
|
||||
err := writeElements(w,
|
||||
c.ChannelID,
|
||||
@@ -53,16 +53,16 @@ func (c *ErrorGeneric) Command() uint32 {
|
||||
}
|
||||
|
||||
func (c *ErrorGeneric) MaxPayloadLength(uint32) uint32 {
|
||||
//8+8192
|
||||
// 8+8192
|
||||
return 8208
|
||||
}
|
||||
|
||||
//Makes sure the struct data is valid (e.g. no negatives or invalid pkscripts)
|
||||
// Makes sure the struct data is valid (e.g. no negatives or invalid pkscripts)
|
||||
func (c *ErrorGeneric) Validate() error {
|
||||
if len(c.Problem) > 8192 {
|
||||
return fmt.Errorf("Problem string length too long")
|
||||
}
|
||||
//We're good!
|
||||
// We're good!
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user