diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-06-10 00:51:09 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-06-10 00:51:09 +0800 |
commit | 5f341e5db5c2c3c14c9e076959a84e05c6d917f4 (patch) | |
tree | 73e61b8040ae81de2a5108d54dd93bf8dba581ae /core | |
parent | fda49f2b5216c7d5655d19efe54651593874adf8 (diff) | |
parent | 73c355591fe0279334675c555b6d614aa25b6781 (diff) | |
download | go-tangerine-5f341e5db5c2c3c14c9e076959a84e05c6d917f4.tar go-tangerine-5f341e5db5c2c3c14c9e076959a84e05c6d917f4.tar.gz go-tangerine-5f341e5db5c2c3c14c9e076959a84e05c6d917f4.tar.bz2 go-tangerine-5f341e5db5c2c3c14c9e076959a84e05c6d917f4.tar.lz go-tangerine-5f341e5db5c2c3c14c9e076959a84e05c6d917f4.tar.xz go-tangerine-5f341e5db5c2c3c14c9e076959a84e05c6d917f4.tar.zst go-tangerine-5f341e5db5c2c3c14c9e076959a84e05c6d917f4.zip |
Merge pull request #1212 from fjl/p2p-eth-block-timeout
eth, p2p: improve write timeouts and behaviour under load
Diffstat (limited to 'core')
-rw-r--r-- | core/transaction_pool.go | 1 | ||||
-rw-r--r-- | core/types/transaction.go | 7 |
2 files changed, 8 insertions, 0 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/core/types/transaction.go b/core/types/transaction.go index 3d6d31ae7..a03a6b847 100644 --- a/core/types/transaction.go +++ b/core/types/transaction.go @@ -67,6 +67,13 @@ func (tx *Transaction) Hash() common.Hash { }) } +// Size returns the encoded RLP size of tx. +func (self *Transaction) Size() common.StorageSize { + c := writeCounter(0) + rlp.Encode(&c, self) + return common.StorageSize(c) +} + func (self *Transaction) Data() []byte { return self.Payload } |