diff options
author | obscuren <geffobscura@gmail.com> | 2015-04-23 16:51:13 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-04-23 17:50:12 +0800 |
commit | fba40e18d9c231b3ab7ee7f6eba36ac859dffbb2 (patch) | |
tree | 31ad5e1d65300b60bdac1ca31e1d7d9290bece9d /core/transaction_pool.go | |
parent | d3be1a271961f13f5bd056d195b790c668552fe1 (diff) | |
download | dexon-fba40e18d9c231b3ab7ee7f6eba36ac859dffbb2.tar dexon-fba40e18d9c231b3ab7ee7f6eba36ac859dffbb2.tar.gz dexon-fba40e18d9c231b3ab7ee7f6eba36ac859dffbb2.tar.bz2 dexon-fba40e18d9c231b3ab7ee7f6eba36ac859dffbb2.tar.lz dexon-fba40e18d9c231b3ab7ee7f6eba36ac859dffbb2.tar.xz dexon-fba40e18d9c231b3ab7ee7f6eba36ac859dffbb2.tar.zst dexon-fba40e18d9c231b3ab7ee7f6eba36ac859dffbb2.zip |
core: added accessor for queued transactions
Diffstat (limited to 'core/transaction_pool.go')
-rw-r--r-- | core/transaction_pool.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/core/transaction_pool.go b/core/transaction_pool.go index 9c175e568..7098dba23 100644 --- a/core/transaction_pool.go +++ b/core/transaction_pool.go @@ -201,6 +201,18 @@ func (self *TxPool) GetTransactions() (txs types.Transactions) { return } +func (self *TxPool) GetQueuedTransactions() types.Transactions { + self.mu.RLock() + defer self.mu.RUnlock() + + var txs types.Transactions + for _, ts := range self.queue { + txs = append(txs, ts...) + } + + return txs +} + func (self *TxPool) RemoveTransactions(txs types.Transactions) { self.mu.Lock() defer self.mu.Unlock() |