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 {
|
||||
return err
|
||||
}
|
||||
if err := bc.verifyTxAttributes(t); err != nil {
|
||||
return err
|
||||
}
|
||||
err = pool.Add(t, bc)
|
||||
if err != nil {
|
||||
switch {
|
||||
|
@ -1249,9 +1252,6 @@ func (bc *Blockchain) verifyAndPoolTx(t *transaction.Transaction, pool *mempool.
|
|||
return err
|
||||
}
|
||||
}
|
||||
if err := bc.verifyTxAttributes(t); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue