From 601c9e769ec3f231b1ae9246da977c71cf43371f Mon Sep 17 00:00:00 2001 From: Antioch Peverell <30642645+antiochp@users.noreply.github.com> Date: Wed, 30 May 2018 10:15:37 -0400 Subject: [PATCH] all duplicates (incorrectly) to maintain compatibility with testnet2 (#1103) --- chain/src/txhashset.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/chain/src/txhashset.rs b/chain/src/txhashset.rs index 07ad5072..41408f57 100644 --- a/chain/src/txhashset.rs +++ b/chain/src/txhashset.rs @@ -513,7 +513,14 @@ impl<'a> Extension<'a> { // processing a new fork so we may get a position on the old // fork that exists but matches a different node // filtering that case out - if hash == OutputIdentifier::from_output(out).hash_with_index(pos - 1) { + // + // TODO - the following call to hash() is *INCORRECT* + // TODO - we should be calling hash_with_index(pos - 1) + // TODO - but we cannot safely make this change in testnet2 + // TODO - with this incorrect behavior we never get a match, so duplicates are + // allowed + // + if hash == OutputIdentifier::from_output(out).hash() { return Err(Error::DuplicateCommitment(commit)); } }