Commit 39b68945 authored by suyanlong's avatar suyanlong

馃悰 fix send ibtp transaction bug

parent 02c8d076
......@@ -40,7 +40,7 @@ func NewPort(client plugins.Client, cryptor txcrypto.Cryptor, logger logrus.Fiel
client: client,
cryptor: cryptor,
logger: logger,
recvCh: make(chan *pb.IBTP, 1024),
recvCh: make(chan *pb.IBTP, port.MaxCapacity),
ctx: ctx,
cancel: cancel,
msgCh: make(chan *pb.Message, port.Capacity),
......
......@@ -47,7 +47,6 @@ func (a *appChain) Send(msg *pb.Message) (*pb.Message, error) {
return nil, errors.New("ibtp wrong")
}
if ibtp.Type == pb.IBTP_RECEIPT_FAILURE || pb.IBTP_RECEIPT_SUCCESS == ibtp.Type {
//
//TODO 榛樿璺敱
ix := pb.IBTPX{
Ibtp: ibtp,
......@@ -87,7 +86,19 @@ func (a *appChain) ListenIBTPX() <-chan *pb.Message {
select {
case ibtp := <-ibtpCh:
// TODO ibtp to ibtpx
data, _ := ibtp.Marshal()
// TODO 榛樿璺敱
ix := pb.IBTPX{
Ibtp: ibtp,
Mode: repo.DirectMode,
RouteSign: []string{},
RouteMethod: router.Single,
RouteMethodArg: []string{},
IsValid: false, // TODO
}
data, err := ix.Marshal()
if err != nil {
a.logger.Error("appchain ListenIBTPX Err: ", err)
}
msg := pb.Msg(pb.Message_IBTP_SEND, true, data)
a.msgCh <- msg
case <-a.ctx.Done():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment