forked from TrueCloudLab/neoneo-go
core: verify transaction attributes before adding it into mempool
Attributes check should be done before adding transaction to the pool, otherwise there might be a case when transaction with invalid attributes is in the pool.
This commit is contained in:
parent
a6579a05ac
commit
95630b72e8
1 changed files with 3 additions and 3 deletions
|
@ -1234,6 +1234,9 @@ func (bc *Blockchain) verifyAndPoolTx(t *transaction.Transaction, pool *mempool.
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if err := bc.verifyTxAttributes(t); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
err = pool.Add(t, bc)
|
err = pool.Add(t, bc)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
switch {
|
switch {
|
||||||
|
@ -1249,9 +1252,6 @@ func (bc *Blockchain) verifyAndPoolTx(t *transaction.Transaction, pool *mempool.
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if err := bc.verifyTxAttributes(t); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue