Skip to content

Commit 73c3555

Browse files
committed
core, eth: document that result of GetTransactions is modifiable
1 parent 8dc3048 commit 73c3555

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

core/transaction_pool.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ func (tp *TxPool) GetTransaction(hash common.Hash) *types.Transaction {
247247
}
248248

249249
// GetTransactions returns all currently processable transactions.
250+
// The returned slice may be modified by the caller.
250251
func (self *TxPool) GetTransactions() (txs types.Transactions) {
251252
self.mu.Lock()
252253
defer self.mu.Unlock()

eth/protocol.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,12 @@ var errorToString = map[int]string{
5757
ErrSuspendedPeer: "Suspended peer",
5858
}
5959

60-
// backend is the interface the ethereum protocol backend should implement
61-
// used as an argument to EthProtocol
6260
type txPool interface {
61+
// AddTransactions should add the given transactions to the pool.
6362
AddTransactions([]*types.Transaction)
63+
64+
// GetTransactions should return pending transactions.
65+
// The slice should be modifiable by the caller.
6466
GetTransactions() types.Transactions
6567
}
6668

0 commit comments

Comments
 (0)