Re-implemented the whole interaction between server, peer and protocol to be more Rust-ish. Server maintains peer references and protocol is internally mutable.
This commit is contained in:
@@ -218,7 +218,7 @@ impl Block {
|
||||
// repeated iterations, revisit if a problem
|
||||
|
||||
// validate each transaction and gather their proofs
|
||||
let mut proofs = try_oap_vec!(txs, |tx| tx.verify_sig(&secp));
|
||||
let mut proofs = try_map_vec!(txs, |tx| tx.verify_sig(&secp));
|
||||
proofs.push(reward_proof);
|
||||
|
||||
// build vectors with all inputs and all outputs, ordering them by hash
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ macro_rules! map_vec {
|
||||
/// Same as map_vec when the map closure returns Results. Makes sure the
|
||||
/// results are "pushed up" and wraps with a try.
|
||||
#[macro_export]
|
||||
macro_rules! try_oap_vec {
|
||||
macro_rules! try_map_vec {
|
||||
($thing:expr, $mapfn:expr ) => {
|
||||
try!($thing.iter()
|
||||
.map($mapfn)
|
||||
|
||||
Reference in New Issue
Block a user