Browse Source

some comments

pull/4/head
Scott Sadler 6 years ago
parent
commit
87d08c5a45
  1. 25
      src/crosschain.cpp
  2. 3
      src/rpccrosschain.cpp

25
src/crosschain.cpp

@ -4,13 +4,28 @@
#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
*/
int NOTARISATION_SCAN_LIMIT_BLOCKS = 1440;
// XXX: There are potential crashes wherever we access chainActive without a lock,
// because it might be disconnecting blocks at the same time.
/*
* This file is built in the server
*/
int NOTARISATION_SCAN_LIMIT_BLOCKS = 1440;
/* On KMD */
uint256 CalculateProofRoot(const char* symbol, uint32_t targetCCid, int kmdHeight,
@ -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;

3
src/rpccrosschain.cpp

@ -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);

Loading…
Cancel
Save