core, eth: document that result of GetTransactions is modifiable
This commit is contained in:
parent
8dc3048f65
commit
73c355591f
|
@ -247,6 +247,7 @@ func (tp *TxPool) GetTransaction(hash common.Hash) *types.Transaction {
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetTransactions returns all currently processable transactions.
|
// GetTransactions returns all currently processable transactions.
|
||||||
|
// The returned slice may be modified by the caller.
|
||||||
func (self *TxPool) GetTransactions() (txs types.Transactions) {
|
func (self *TxPool) GetTransactions() (txs types.Transactions) {
|
||||||
self.mu.Lock()
|
self.mu.Lock()
|
||||||
defer self.mu.Unlock()
|
defer self.mu.Unlock()
|
||||||
|
|
|
@ -57,10 +57,12 @@ var errorToString = map[int]string{
|
||||||
ErrSuspendedPeer: "Suspended peer",
|
ErrSuspendedPeer: "Suspended peer",
|
||||||
}
|
}
|
||||||
|
|
||||||
// backend is the interface the ethereum protocol backend should implement
|
|
||||||
// used as an argument to EthProtocol
|
|
||||||
type txPool interface {
|
type txPool interface {
|
||||||
|
// AddTransactions should add the given transactions to the pool.
|
||||||
AddTransactions([]*types.Transaction)
|
AddTransactions([]*types.Transaction)
|
||||||
|
|
||||||
|
// GetTransactions should return pending transactions.
|
||||||
|
// The slice should be modifiable by the caller.
|
||||||
GetTransactions() types.Transactions
|
GetTransactions() types.Transactions
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue