Appends a new leaf to the MMR.
(&mut self, leaf: [u8; 32])
| 19 | |
| 20 | /// Appends a new leaf to the MMR. |
| 21 | pub fn append(&mut self, leaf: [u8; 32]) { |
| 22 | self.nodes[0].push(leaf); |
| 23 | self.recalculate_peaks(); |
| 24 | } |
| 25 | |
| 26 | /// Recalculates peaks based on the current leaves. |
| 27 | fn recalculate_peaks(&mut self) { |