Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Musiczombie committed Dec 5, 2019
1 parent 4050338 commit 46f0fe4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion task/fee.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,19 @@ func (f *FeeTask) getTokenName(dbTx *sql.Tx, name string) (string, error) {
func (f *FeeTask) analysisFeeAction(data *types.BlockAndResult, dbTx *sql.Tx) error {
receipts := data.Receipts
txs := data.Block.Txs
bigZero := big.NewInt(0)
for i, receipt := range receipts {
tx := txs[i]
gasPrice := big.NewInt(0).Set(tx.GasPrice)
for j, aRs := range receipt.ActionResults {
at := tx.RPCActions[j]
for k, aR := range aRs.GasAllot {
fee := big.NewInt(0).Mul(big.NewInt(int64(aR.Gas)), tx.GasPrice)
if tx.GasPrice.Cmp(bigZero) == 0 {
if at.PayerGasPrice != nil {
gasPrice.Set(at.PayerGasPrice)
}
}
fee := big.NewInt(0).Mul(big.NewInt(int64(aR.Gas)), gasPrice)
mFee := &db.MysqlFee{
TxHash: tx.Hash.String(),
ActionHash: at.ActionHash.String(),
Expand Down

0 comments on commit 46f0fe4

Please sign in to comment.