core, eth, les: polish txpool API around local/remote txs

This commit is contained in:
Péter Szilágyi
2017-07-05 16:51:55 +03:00
parent a633a2d7ea
commit 48ee7f9de7
9 changed files with 153 additions and 149 deletions

View File

@ -87,8 +87,8 @@ type BlockChain interface {
}
type txPool interface {
// AddTransactions should add the given transactions to the pool.
AddBatch([]*types.Transaction) error
// AddRemotes should add the given transactions to the pool.
AddRemotes([]*types.Transaction) error
}
type ProtocolManager struct {
@ -803,7 +803,7 @@ func (pm *ProtocolManager) handleMsg(p *peer) error {
return errResp(ErrRequestRejected, "")
}
if err := pm.txpool.AddBatch(txs); err != nil {
if err := pm.txpool.AddRemotes(txs); err != nil {
return errResp(ErrUnexpectedResponse, "msg: %v", err)
}