From 05908caa14a5db6c9207fad84cb367beace1365d Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Thu, 6 Dec 2018 20:26:41 +0800 Subject: [PATCH] Prevent possible skip of notarisation on KMD --- src/crosschain.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/crosschain.cpp b/src/crosschain.cpp index 250a0e6ca..56c310ce7 100644 --- a/src/crosschain.cpp +++ b/src/crosschain.cpp @@ -69,7 +69,7 @@ uint256 CalculateProofRoot(const char* symbol, uint32_t targetCCid, int kmdHeigh destNotarisationTxid = nota.first; else if (seenOwnNotarisations == 2) goto end; - break; + //break; } } @@ -97,7 +97,7 @@ int ScanNotarisationsFromHeight(int nHeight, const IsTarget f, Notarisation &fou { int limit = std::min(nHeight + NOTARISATION_SCAN_LIMIT_BLOCKS, chainActive.Height()); int start = std::max(nHeight, 1); - + for (int h=start; hGetHeight(), isTarget, nota)) throw std::runtime_error("backnotarisation not yet confirmed"); - + // index of block in MoM leaves nIndex = nota.second.height - blockIndex->GetHeight(); } @@ -325,7 +325,7 @@ TxProof GetAssetchainProof(uint256 hash) } bool fMutated; BuildMerkleTree(&fMutated, leaves, tree); - branch = GetMerkleBranch(nIndex, leaves.size(), tree); + branch = GetMerkleBranch(nIndex, leaves.size(), tree); // Check branch uint256 ourResult = SafeCheckMerkleBranch(blockIndex->hashMerkleRoot, branch, nIndex); @@ -364,7 +364,7 @@ TxProof GetAssetchainProof(uint256 hash) } // Check the proof - if (nota.second.MoM != CBlock::CheckMerkleBranch(hash, branch, nIndex)) + if (nota.second.MoM != CBlock::CheckMerkleBranch(hash, branch, nIndex)) throw std::runtime_error("Failed validating MoM"); // All done!