Skip to content

Commit

Permalink
Merge pull request #152 from lbtsm/main
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
mapdev33 authored Apr 24, 2024
2 parents 6994150 + e630a6e commit fab6f2a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/chain/oracle.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,15 @@ func DefaultOracleHandler(m *Oracle, latestBlock *big.Int) error {
id := big.NewInt(0).SetUint64(uint64(m.Cfg.Id))
if m.Cfg.Id == m.Cfg.MapChainID {
toChainID := binary.BigEndian.Uint64(logs[0].Topics[1][len(logs[0].Topics[1])-8:])
data, err := mapprotocol.PackInput(mapprotocol.LightManger, mapprotocol.MethodUpdateBlockHeader, big.NewInt(int64(m.Cfg.Id)), input)
if err != nil {
return err
}
for _, cid := range m.Cfg.SyncChainIDList {
if toChainID != uint64(cid) {
continue
}
message := msg.NewSyncFromMap(m.Cfg.MapChainID, cid, []interface{}{id, input}, m.MsgCh)
message := msg.NewSyncFromMap(m.Cfg.MapChainID, cid, []interface{}{data}, m.MsgCh)
err = m.Router.Send(message)
if err != nil {
m.Log.Error("subscription error: failed to route message", "err", err)
Expand Down

0 comments on commit fab6f2a

Please sign in to comment.