MCPcopy Create free account
hub / github.com/33cn/chain33 / send

Method send

client/queueprotocol.go:71–85  ·  view source on GitHub ↗
(topic string, ty int64, data interface{})

Source from the content-addressed store, hash-verified

69}
70
71func (q *QueueProtocol) send(topic string, ty int64, data interface{}) (*queue.Message, error) {
72 client := q.client
73 msg := client.NewMessage(topic, ty, data)
74 err := client.SendTimeout(msg, true, q.option.SendTimeout)
75 if err != nil {
76 return &queue.Message{}, err
77 }
78 reply, err := client.WaitTimeout(msg, q.option.WaitTimeout)
79 if err != nil {
80 return nil, err
81 }
82 //NOTE:内部错误情况较多,只对正确流程msg回收
83 client.FreeMessage(msg)
84 return reply, nil
85}
86
87func (q *QueueProtocol) notify(topic string, ty int64, data interface{}) (*queue.Message, error) {
88 client := q.client

Callers 15

Send2MempoolMethod · 0.95
GetTxListMethod · 0.95
GetTxListByAddrMethod · 0.95
RemoveTxsByHashListMethod · 0.95
GetBlocksMethod · 0.95
QueryTxMethod · 0.95
GetTransactionByAddrMethod · 0.95
GetTransactionByHashMethod · 0.95
GetMempoolMethod · 0.95
PeerInfoMethod · 0.95
NetProtocolsMethod · 0.95
GetHeadersMethod · 0.95

Calls 4

NewMessageMethod · 0.65
SendTimeoutMethod · 0.65
WaitTimeoutMethod · 0.65
FreeMessageMethod · 0.65

Tested by

no test coverage detected