refactor(executor): refactor illegal tx handling

when the destination chain id is illegal, bitxhub should ignore it instead of returning error. The appchain which invoked this tx will wait for this tx to timeout.
This commit is contained in:
Alexader 2020-04-16 19:46:14 +08:00
parent 9ebc083a89
commit ec0bd485d6
1 changed files with 3 additions and 2 deletions

View File

@ -274,12 +274,13 @@ func (x *Interchain) HandleIBTP(data []byte) *boltvm.Response {
}
if ibtp.To == "" {
return boltvm.Error("target appchain is empty")
return boltvm.Error("empty destination chain id")
}
ok = x.Has(x.appchainKey(ibtp.To))
if !ok {
return boltvm.Error("target appchain does not exist")
x.Logger().WithField("chain_id", ibtp.To).Warn("target appchain does not exist")
return boltvm.Success(nil)
}
app := &appchain{}