core/txpool: don't inject lazy resolved transactions into the container (#28917)
* core/txpool: don't inject lazy resolved transactions into the container * core/txpool: minor typo fixes
This commit is contained in:
parent
62affdc9c5
commit
47d76c5f95
@ -44,12 +44,18 @@ type LazyTransaction struct {
|
|||||||
|
|
||||||
// Resolve retrieves the full transaction belonging to a lazy handle if it is still
|
// Resolve retrieves the full transaction belonging to a lazy handle if it is still
|
||||||
// maintained by the transaction pool.
|
// maintained by the transaction pool.
|
||||||
|
//
|
||||||
|
// Note, the method will *not* cache the retrieved transaction if the original
|
||||||
|
// pool has not cached it. The idea being, that if the tx was too big to insert
|
||||||
|
// originally, silently saving it will cause more trouble down the line (and
|
||||||
|
// indeed seems to have caused a memory bloat in the original implementation
|
||||||
|
// which did just that).
|
||||||
func (ltx *LazyTransaction) Resolve() *types.Transaction {
|
func (ltx *LazyTransaction) Resolve() *types.Transaction {
|
||||||
if ltx.Tx == nil {
|
if ltx.Tx != nil {
|
||||||
ltx.Tx = ltx.Pool.Get(ltx.Hash)
|
|
||||||
}
|
|
||||||
return ltx.Tx
|
return ltx.Tx
|
||||||
}
|
}
|
||||||
|
return ltx.Pool.Get(ltx.Hash)
|
||||||
|
}
|
||||||
|
|
||||||
// LazyResolver is a minimal interface needed for a transaction pool to satisfy
|
// LazyResolver is a minimal interface needed for a transaction pool to satisfy
|
||||||
// resolving lazy transactions. It's mostly a helper to avoid the entire sub-
|
// resolving lazy transactions. It's mostly a helper to avoid the entire sub-
|
||||||
|
Loading…
Reference in New Issue
Block a user