Skip to content

Commit

Permalink
no log for 0 matic transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
jdkanani committed Oct 25, 2019
1 parent 15aeef0 commit 223f6a8
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions core/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,20 +238,18 @@ func (st *StateTransition) TransitionDb() (ret []byte, usedGas uint64, failed bo
output2 := new(big.Int).SetBytes(input2.Bytes())

// add transfer log
if amount.Cmp(bigZero) > 0 {
AddFeeTransferLog(
st.state,

msg.From(),
st.evm.Coinbase,

amount,
input1,
input2,
output1.Sub(output1, amount),
output2.Add(output2, amount),
)
}
AddFeeTransferLog(
st.state,

msg.From(),
st.evm.Coinbase,

amount,
input1,
input2,
output1.Sub(output1, amount),
output2.Add(output2, amount),
)

return ret, st.gasUsed(), vmerr != nil, err
}
Expand Down Expand Up @@ -348,6 +346,11 @@ func addTransferLog(
output1,
output2 *big.Int,
) {
// ignore if amount is 0
if amount.Cmp(bigZero) <= 0 {
return
}

dataInputs := []*big.Int{
amount,
input1,
Expand Down

0 comments on commit 223f6a8

Please sign in to comment.