From 054114027f9e1c5815686ea45ed47401c4208425 Mon Sep 17 00:00:00 2001 From: Ignotus Peverell Date: Thu, 22 Mar 2018 04:58:25 +0000 Subject: [PATCH] Index first when hashing nodes in MMR. Fixes #814 --- core/src/ser.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/ser.rs b/core/src/ser.rs index b18910bdd..cbbb1ec3b 100644 --- a/core/src/ser.rs +++ b/core/src/ser.rs @@ -565,14 +565,14 @@ pub trait PMMRIndexHashable { impl PMMRIndexHashable for T { fn hash_with_index(&self, index: u64) -> Hash { - (self, index).hash() + (index, self).hash() } } // Convenient way to hash two existing hashes together with an index. impl PMMRIndexHashable for (Hash, Hash) { fn hash_with_index(&self, index: u64) -> Hash { - (&self.0, &self.1, index).hash() + (index, &self.0, &self.1).hash() } }