Skip to content

Commit

Permalink
add fees log if fees > 0
Browse files Browse the repository at this point in the history
  • Loading branch information
jdkanani committed Oct 21, 2019
1 parent 4ea1f33 commit 15aeef0
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions core/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ var (
var transferLogSig = common.HexToHash("0xe6497e3ee548a3372136af2fcb0696db31fc6cf20260707645068bd3fe97f3c4")
var transferFeeLogSig = common.HexToHash("0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63")
var feeAddress = common.HexToAddress("0x0000000000000000000000000000000000001010")
var bigZero = big.NewInt(0)

/*
The State Transitioning Model
Expand Down Expand Up @@ -237,18 +238,20 @@ func (st *StateTransition) TransitionDb() (ret []byte, usedGas uint64, failed bo
output2 := new(big.Int).SetBytes(input2.Bytes())

// add transfer log
AddFeeTransferLog(
st.state,

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

amount,
input1,
input2,
output1.Sub(output1, amount),
output2.Add(output2, amount),
)
if amount.Cmp(bigZero) > 0 {
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

0 comments on commit 15aeef0

Please sign in to comment.