Skip to content

Commit

Permalink
assetid bug
Browse files Browse the repository at this point in the history
  • Loading branch information
osoftdeveloper committed Nov 18, 2019
1 parent 63379a3 commit 61f80d5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion db/internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func InsertInternalAction(data *MysqlInternal, dbTx *sql.Tx) error {
_, err = stmt.Exec(data.TxHash, data.ActionHash, data.Height, data.Created, data.ActionIndex, data.InternalIndex, data.AssetId,
data.ActionType, data.From, data.To, data.Amount.String(), data.GasLimit, data.GasUsed, data.Depth, strconv.FormatUint(data.State, 10), data.ErrorMsg, data.Payload)
if err != nil {
ZapLog.Panic("InsertInternalAction error", zap.Error(err), zap.String("txHash", data.TxHash))
ZapLog.Panic("InsertInternalAction error", zap.Error(err), zap.String("txHash", data.TxHash), zap.Uint64("assetid", data.AssetId))
}
return nil
}
Expand Down
6 changes: 6 additions & 0 deletions task/internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ type InternalTask struct {
*Base
}

const maxuint = 2147483647

func (i *InternalTask) analysisInternalAction(data *types.BlockAndResult, dbTx *sql.Tx) error {
for i, itx := range data.DetailTxs {
tx := data.Block.Txs[i]
Expand All @@ -38,6 +40,10 @@ func (i *InternalTask) analysisInternalAction(data *types.BlockAndResult, dbTx *
}
}
}

if uint64(maxuint) < ia.Action.AssetID {
ia.Action.AssetID = uint64(maxuint)
}
mInternal := &db.MysqlInternal{
TxHash: tx.Hash.String(),
ActionHash: a.ActionHash.String(),
Expand Down

0 comments on commit 61f80d5

Please sign in to comment.