core: set NetworkFee to 0 for Claim and Miner transactions
Claim tx have no GAS inputs and a positive output which can lead to negative network fee.
This commit is contained in:
parent
21ef2638c0
commit
9e9d59b49a
1 changed files with 5 additions and 0 deletions
|
@ -1168,6 +1168,11 @@ func (bc *Blockchain) FeePerByte(t *transaction.Transaction) util.Fixed8 {
|
|||
|
||||
// NetworkFee returns network fee.
|
||||
func (bc *Blockchain) NetworkFee(t *transaction.Transaction) util.Fixed8 {
|
||||
// https://github.com/neo-project/neo/blob/master-2.x/neo/Network/P2P/Payloads/ClaimTransaction.cs#L16
|
||||
if t.Type == transaction.ClaimType || t.Type == transaction.MinerType {
|
||||
return 0
|
||||
}
|
||||
|
||||
inputAmount := util.Fixed8FromInt64(0)
|
||||
refs, err := bc.References(t)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in a new issue