mirror of
https://gitlab.com/pulsechaincom/go-pulse.git
synced 2024-12-24 12:27:17 +00:00
core: added accessor for queued transactions
This commit is contained in:
parent
d3be1a2719
commit
fba40e18d9
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user