aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-06-09 23:03:07 +0800
committerFelix Lange <fjl@twurst.com>2015-06-09 23:07:10 +0800
commit73c355591fe0279334675c555b6d614aa25b6781 (patch)
tree73e61b8040ae81de2a5108d54dd93bf8dba581ae
parent8dc3048f6556e3fb2f719f383834332656b4c8fe (diff)
downloadgo-tangerine-73c355591fe0279334675c555b6d614aa25b6781.tar
go-tangerine-73c355591fe0279334675c555b6d614aa25b6781.tar.gz
go-tangerine-73c355591fe0279334675c555b6d614aa25b6781.tar.bz2
go-tangerine-73c355591fe0279334675c555b6d614aa25b6781.tar.lz
go-tangerine-73c355591fe0279334675c555b6d614aa25b6781.tar.xz
go-tangerine-73c355591fe0279334675c555b6d614aa25b6781.tar.zst
go-tangerine-73c355591fe0279334675c555b6d614aa25b6781.zip
core, eth: document that result of GetTransactions is modifiable
-rw-r--r--core/transaction_pool.go1
-rw-r--r--eth/protocol.go6
2 files changed, 5 insertions, 2 deletions
diff --git a/core/transaction_pool.go b/core/transaction_pool.go
index 77744f8f7..918e7b957 100644
--- a/core/transaction_pool.go
+++ b/core/transaction_pool.go
@@ -247,6 +247,7 @@ func (tp *TxPool) GetTransaction(hash common.Hash) *types.Transaction {
}
// GetTransactions returns all currently processable transactions.
+// The returned slice may be modified by the caller.
func (self *TxPool) GetTransactions() (txs types.Transactions) {
self.mu.Lock()
defer self.mu.Unlock()
diff --git a/eth/protocol.go b/eth/protocol.go
index 9ccf2cb60..57805d9bd 100644
--- a/eth/protocol.go
+++ b/eth/protocol.go
@@ -57,10 +57,12 @@ var errorToString = map[int]string{
ErrSuspendedPeer: "Suspended peer",
}
-// backend is the interface the ethereum protocol backend should implement
-// used as an argument to EthProtocol
type txPool interface {
+ // AddTransactions should add the given transactions to the pool.
AddTransactions([]*types.Transaction)
+
+ // GetTransactions should return pending transactions.
+ // The slice should be modifiable by the caller.
GetTransactions() types.Transactions
}