some comments

This commit is contained in:
Scott Sadler
2018-06-19 20:39:04 -03:00
parent 469bd6378f
commit 87d08c5a45
2 changed files with 21 additions and 7 deletions

View File

@@ -4,14 +4,29 @@
#include "main.h"
#include "notarisationdb.h"
/*
* The crosschain workflow.
*
* 3 chains, A, B, and KMD. We would like to prove TX on B.
* There is a notarisation, nA0, which will include TX via an MoM.
* The notarisation nA0 must fall between 2 notarisations of B,
* ie, nB0 and nB1. An MoMoM including this range is propagated to
* B in notarisation receipt (backnotarisation) bnB2.
*
* A: TX bnA0
* \ /
* KMD: nB0 nA0 nB1 nB2
* \ \ \
* B: bnB0 bnB1 bnB2
*/
// XXX: There are potential crashes wherever we access chainActive without a lock,
// because it might be disconnecting blocks at the same time.
int NOTARISATION_SCAN_LIMIT_BLOCKS = 1440;
/*
* This file is built in the server
*/
/* On KMD */
uint256 CalculateProofRoot(const char* symbol, uint32_t targetCCid, int kmdHeight,
std::vector<uint256> &moms, uint256 &destNotarisationTxid)
@@ -258,7 +273,7 @@ TxProof GetAssetchainProof(uint256 hash)
return nota.second.height >= blockIndex->nHeight;
};
if (!ScanNotarisationsFromHeight(blockIndex->nHeight, isTarget, nota))
throw std::runtime_error("notarisation not found");
throw std::runtime_error("backnotarisation not yet confirmed");
// index of block in MoM leaves
nIndex = nota.second.height - blockIndex->nHeight;

View File

@@ -19,11 +19,10 @@
#include "script/standard.h"
#include <stdint.h>
#include <univalue.h>
#include <regex>
using namespace std;
int32_t komodo_MoM(int32_t *notarized_htp,uint256 *MoMp,uint256 *kmdtxidp,int32_t nHeight,uint256 *MoMoMp,int32_t *MoMoMoffsetp,int32_t *MoMoMdepthp,int32_t *kmdstartip,int32_t *kmdendip);