mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-26 19:42:23 +00:00
core: drop stale transactions from the mempool
They're no longer valid if `ValidUntilBlock == curheight`.
This commit is contained in:
parent
6025c13a6d
commit
a154481860
1 changed files with 4 additions and 0 deletions
|
@ -1305,7 +1305,11 @@ func (bc *Blockchain) verifyTxAttributes(tx *transaction.Transaction) error {
|
|||
// correctness, presence in blocks before the new one, etc.
|
||||
func (bc *Blockchain) isTxStillRelevant(t *transaction.Transaction, txpool *mempool.Pool) bool {
|
||||
var recheckWitness bool
|
||||
var curheight = bc.BlockHeight()
|
||||
|
||||
if t.ValidUntilBlock <= curheight {
|
||||
return false
|
||||
}
|
||||
if txpool == nil {
|
||||
if bc.dao.HasTransaction(t.Hash()) {
|
||||
return false
|
||||
|
|
Loading…
Reference in a new issue