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 ...@@ -40,7 +40,7 @@ func NewPort(client plugins.Client, cryptor txcrypto.Cryptor, logger logrus.Fiel
client: client, client: client,
cryptor: cryptor, cryptor: cryptor,
logger: logger, logger: logger,
recvCh: make(chan *pb.IBTP, 1024), recvCh: make(chan *pb.IBTP, port.MaxCapacity),
ctx: ctx, ctx: ctx,
cancel: cancel, cancel: cancel,
msgCh: make(chan *pb.Message, port.Capacity), msgCh: make(chan *pb.Message, port.Capacity),
......
...@@ -47,7 +47,6 @@ func (a *appChain) Send(msg *pb.Message) (*pb.Message, error) { ...@@ -47,7 +47,6 @@ func (a *appChain) Send(msg *pb.Message) (*pb.Message, error) {
return nil, errors.New("ibtp wrong") return nil, errors.New("ibtp wrong")
} }
if ibtp.Type == pb.IBTP_RECEIPT_FAILURE || pb.IBTP_RECEIPT_SUCCESS == ibtp.Type { if ibtp.Type == pb.IBTP_RECEIPT_FAILURE || pb.IBTP_RECEIPT_SUCCESS == ibtp.Type {
//
//TODO 榛樿璺敱 //TODO 榛樿璺敱
ix := pb.IBTPX{ ix := pb.IBTPX{
Ibtp: ibtp, Ibtp: ibtp,
...@@ -87,7 +86,19 @@ func (a *appChain) ListenIBTPX() <-chan *pb.Message { ...@@ -87,7 +86,19 @@ func (a *appChain) ListenIBTPX() <-chan *pb.Message {
select { select {
case ibtp := <-ibtpCh: case ibtp := <-ibtpCh:
// TODO ibtp to ibtpx // 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) msg := pb.Msg(pb.Message_IBTP_SEND, true, data)
a.msgCh <- msg a.msgCh <- msg
case <-a.ctx.Done(): 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