some comments
This commit is contained in:
@@ -4,14 +4,29 @@
|
|||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "notarisationdb.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;
|
int NOTARISATION_SCAN_LIMIT_BLOCKS = 1440;
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This file is built in the server
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* On KMD */
|
/* On KMD */
|
||||||
uint256 CalculateProofRoot(const char* symbol, uint32_t targetCCid, int kmdHeight,
|
uint256 CalculateProofRoot(const char* symbol, uint32_t targetCCid, int kmdHeight,
|
||||||
std::vector<uint256> &moms, uint256 &destNotarisationTxid)
|
std::vector<uint256> &moms, uint256 &destNotarisationTxid)
|
||||||
@@ -258,7 +273,7 @@ TxProof GetAssetchainProof(uint256 hash)
|
|||||||
return nota.second.height >= blockIndex->nHeight;
|
return nota.second.height >= blockIndex->nHeight;
|
||||||
};
|
};
|
||||||
if (!ScanNotarisationsFromHeight(blockIndex->nHeight, isTarget, nota))
|
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
|
// index of block in MoM leaves
|
||||||
nIndex = nota.second.height - blockIndex->nHeight;
|
nIndex = nota.second.height - blockIndex->nHeight;
|
||||||
|
|||||||
@@ -19,11 +19,10 @@
|
|||||||
#include "script/standard.h"
|
#include "script/standard.h"
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <univalue.h>
|
#include <univalue.h>
|
||||||
|
|
||||||
#include <regex>
|
#include <regex>
|
||||||
|
|
||||||
|
|
||||||
using namespace std;
|
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);
|
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);
|
||||||
|
|||||||
Reference in New Issue
Block a user