Insert a transaction we could not submit straight away into the buffer.
(&self, sender: Address, nonce: Nonce, msg: ChainMessage)
| 34 | impl TransactionBuffer { |
| 35 | /// Insert a transaction we could not submit straight away into the buffer. |
| 36 | pub fn insert(&self, sender: Address, nonce: Nonce, msg: ChainMessage) { |
| 37 | self.0.with(|c| { |
| 38 | let buffer = c.entry(sender).or_insert_with(BTreeMap::new); |
| 39 | // Overwrite any previous entry to protect against DoS attack; it wouldn't make sense to submit them anyway. |
| 40 | buffer.insert(nonce, msg); |
| 41 | }) |
| 42 | } |
| 43 | |
| 44 | /// Remove all (sender, nonce) pairs which were included in a block. |
| 45 | fn remove_many<'a, I>(&self, txs: I) |