Added Error message type to wire protocol

This commit is contained in:
Joseph Poon
2016-01-05 08:53:42 -08:00
committed by Olaoluwa Osuntokun
parent f3849f5c10
commit b4c644c99a
5 changed files with 144 additions and 6 deletions

View File

@@ -57,6 +57,9 @@ const (
//Commitments
CmdCommitSignature = uint32(2000)
CmdCommitRevocation = uint32(2010)
//Error
CmdErrorGeneric = uint32(4000)
)
//Every message has these functions:
@@ -103,6 +106,8 @@ func makeEmptyMessage(command uint32) (Message, error) {
msg = &CommitSignature{}
case CmdCommitRevocation:
msg = &CommitRevocation{}
case CmdErrorGeneric:
msg = &ErrorGeneric{}
default:
return nil, fmt.Errorf("unhandled command [%d]", command)
}