mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-11-24 14:35:53 +00:00
44 lines
1.3 KiB
Go
44 lines
1.3 KiB
Go
package appmessage
|
|
|
|
// GetIncludingBlockOfTxRequestMessage is an appmessage corresponding to
|
|
// its respective RPC message
|
|
type GetIncludingBlockOfTxRequestMessage struct {
|
|
baseMessage
|
|
TxID string
|
|
IncludeTransactions bool
|
|
}
|
|
|
|
// Command returns the protocol command string for the message
|
|
func (msg *GetIncludingBlockOfTxRequestMessage) Command() MessageCommand {
|
|
return CmdGetIncludingBlockOfTxRequestMessage
|
|
}
|
|
|
|
// NewGetIncludingBlockOfTxRequest returns a instance of the message
|
|
func NewGetIncludingBlockOfTxRequest(txID string, includeTransactions bool) *GetIncludingBlockOfTxRequestMessage {
|
|
return &GetIncludingBlockOfTxRequestMessage{
|
|
TxID: txID,
|
|
IncludeTransactions: includeTransactions,
|
|
}
|
|
}
|
|
|
|
// GetIncludingBlockOfTxResponseMessage is an appmessage corresponding to
|
|
// its respective RPC message
|
|
type GetIncludingBlockOfTxResponseMessage struct {
|
|
baseMessage
|
|
Block *RPCBlock
|
|
|
|
Error *RPCError
|
|
}
|
|
|
|
// Command returns the protocol command string for the message
|
|
func (msg *GetIncludingBlockOfTxResponseMessage) Command() MessageCommand {
|
|
return CmdGetIncludingBlockOfTxResponseMessage
|
|
}
|
|
|
|
// NewGetIncludingBlockOfTxResponse returns an instance of the message
|
|
func NewGetIncludingBlockOfTxResponse(block *RPCBlock) *GetIncludingBlockOfTxResponseMessage {
|
|
return &GetIncludingBlockOfTxResponseMessage{
|
|
Block: block,
|
|
}
|
|
}
|