mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-18 16:44:12 +00:00
3980fa7d45
* implementation * tidy gomod * linters * fix cmd test * fix * fix lint
27 lines
585 B
Go
27 lines
585 B
Go
package core
|
|
|
|
import (
|
|
"github.com/ledgerwatch/turbo-geth/common"
|
|
"github.com/ledgerwatch/turbo-geth/core/types"
|
|
"github.com/ledgerwatch/turbo-geth/rlp"
|
|
)
|
|
|
|
type RawTxPool TxPool
|
|
|
|
func RawFromTxPool(pool *TxPool) *RawTxPool {
|
|
return (*RawTxPool)(pool)
|
|
}
|
|
|
|
func TxPoolFromRaw(pool *RawTxPool) *TxPool {
|
|
return (*TxPool)(pool)
|
|
}
|
|
|
|
func (pool *RawTxPool) AddLocal(signedtx []byte) ([]byte, error) {
|
|
tx := new(types.Transaction)
|
|
if err := rlp.DecodeBytes(signedtx, tx); err != nil {
|
|
return common.Hash{}.Bytes(), err
|
|
}
|
|
|
|
return tx.Hash().Bytes(), TxPoolFromRaw(pool).AddLocal(tx)
|
|
}
|