Integrate sum trees with the rest of the system (#116)

* Integrate PMMR and its persistent backend with the Chain
* Chain can set tree roots; PMMR backend discard
* Check spent and prune for each input in new block
* Handling of forks by rewinding the state
* More PMMR tests and fixes, mostly around rewind
* Rewrite get_unspent to use the sumtrees, fix remaining compilation issues
This commit is contained in:
Ignotus Peverell
2017-09-27 23:46:32 +00:00
committed by GitHub
parent 8800d1339d
commit 36bcd3cc39
22 changed files with 951 additions and 1420 deletions
+3 -1
View File
@@ -25,6 +25,7 @@ use rand;
use std::fmt;
use core::core;
use core::core::hash::Hashed;
/// An entry in the transaction pool.
/// These are the vertices of both of the graph structures
@@ -214,7 +215,8 @@ impl DirectedGraph {
/// proofs and any extra data the kernel may cover, but it is used initially
/// for testing purposes.
pub fn transaction_identifier(tx: &core::transaction::Transaction) -> core::hash::Hash {
core::transaction::merkle_inputs_outputs(&tx.inputs, &tx.outputs)
// core::transaction::merkle_inputs_outputs(&tx.inputs, &tx.outputs)
tx.hash()
}
#[cfg(test)]