core: added accessor for queued transactions

This commit is contained in:
obscuren 2015-04-23 10:51:13 +02:00
parent d3be1a2719
commit fba40e18d9
1 changed files with 12 additions and 0 deletions

View File

@ -201,6 +201,18 @@ func (self *TxPool) GetTransactions() (txs types.Transactions) {
return 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) { func (self *TxPool) RemoveTransactions(txs types.Transactions) {
self.mu.Lock() self.mu.Lock()
defer self.mu.Unlock() defer self.mu.Unlock()