Browse Source

Merge branch 'dev' of https://github.com/jl777/komodo into jl777-dev

fix merge conflict
jl777
blackjok3r 6 years ago
parent
commit
876a6e0f9b
  1. 9
      src/assetchains.json
  2. 2
      src/assetchains.old
  3. 12
      src/crosschain.cpp
  4. 2
      src/komodo_notary.h
  5. 9
      src/main.cpp
  6. 5
      src/notarisationdb.cpp
  7. 2
      src/rpcblockchain.cpp
  8. 2
      src/rpcmining.cpp
  9. 10
      src/wallet/rpcwallet.cpp

9
src/assetchains.json

@ -45,7 +45,8 @@
}, },
{ {
"ac_name": "COQUI", "ac_name": "COQUI",
"ac_supply": "72000000" "ac_supply": "72000000",
"ac_ccactivate": "200000"
}, },
{ {
"ac_name": "WLC", "ac_name": "WLC",
@ -140,7 +141,9 @@
"ac_cc": "2", "ac_cc": "2",
"addressindex": "1", "addressindex": "1",
"spentindex": "1", "spentindex": "1",
"addnode": "142.93.136.89", "addnode": [
"addnode": "195.201.22.89" "142.93.136.89",
"195.201.22.89"
]
} }
] ]

2
src/assetchains.old

@ -15,7 +15,7 @@ echo $pubkey
./komodod -pubkey=$pubkey -ac_name=MSHARK -ac_supply=1400000 -addnode=78.47.196.146 $1 & ./komodod -pubkey=$pubkey -ac_name=MSHARK -ac_supply=1400000 -addnode=78.47.196.146 $1 &
./komodod -pubkey=$pubkey -ac_name=BOTS -ac_supply=999999 -addnode=78.47.196.146 $1 & ./komodod -pubkey=$pubkey -ac_name=BOTS -ac_supply=999999 -addnode=78.47.196.146 $1 &
./komodod -pubkey=$pubkey -ac_name=MGW -ac_supply=999999 -addnode=78.47.196.146 $1 & ./komodod -pubkey=$pubkey -ac_name=MGW -ac_supply=999999 -addnode=78.47.196.146 $1 &
./komodod -pubkey=$pubkey -ac_name=COQUI -ac_supply=72000000 -addnode=78.47.196.146 $1 & ./komodod -pubkey=$pubkey -ac_name=COQUI -ac_supply=72000000 -ac_ccactivate=200000 -addnode=78.47.196.146 $1 &
./komodod -pubkey=$pubkey -ac_name=WLC -ac_supply=210000000 -addnode=148.251.190.89 $1 & ./komodod -pubkey=$pubkey -ac_name=WLC -ac_supply=210000000 -addnode=148.251.190.89 $1 &
./komodod -pubkey=$pubkey -ac_name=KV -ac_supply=1000000 -addnode=78.47.196.146 $1 & ./komodod -pubkey=$pubkey -ac_name=KV -ac_supply=1000000 -addnode=78.47.196.146 $1 &
./komodod -pubkey=$pubkey -ac_name=CEAL -ac_supply=366666666 -addnode=78.47.196.146 $1 & ./komodod -pubkey=$pubkey -ac_name=CEAL -ac_supply=366666666 -addnode=78.47.196.146 $1 &

12
src/crosschain.cpp

@ -95,7 +95,7 @@ template <typename IsTarget>
int ScanNotarisationsFromHeight(int nHeight, const IsTarget f, Notarisation &found) int ScanNotarisationsFromHeight(int nHeight, const IsTarget f, Notarisation &found)
{ {
int limit = std::min(nHeight + NOTARISATION_SCAN_LIMIT_BLOCKS, chainActive.Height()); int limit = std::min(nHeight + NOTARISATION_SCAN_LIMIT_BLOCKS, chainActive.Height());
for (int h=nHeight; h<limit; h++) { for (int h=nHeight; h<limit; h++) {
NotarisationsInBlock notarisations; NotarisationsInBlock notarisations;
@ -124,7 +124,7 @@ TxProof GetCrossChainProof(const uint256 txid, const char* targetSymbol, uint32_
*/ */
EvalRef eval; EvalRef eval;
uint256 MoM = assetChainProof.second.Exec(txid); uint256 MoM = assetChainProof.second.Exec(txid);
// Get a kmd height for given notarisation Txid // Get a kmd height for given notarisation Txid
int kmdHeight; int kmdHeight;
{ {
@ -156,7 +156,7 @@ TxProof GetCrossChainProof(const uint256 txid, const char* targetSymbol, uint32_
uint256 MoMoM = CalculateProofRoot(targetSymbol, targetCCid, kmdHeight, moms, targetChainNotarisationTxid); uint256 MoMoM = CalculateProofRoot(targetSymbol, targetCCid, kmdHeight, moms, targetChainNotarisationTxid);
if (MoMoM.IsNull()) if (MoMoM.IsNull())
throw std::runtime_error("No MoMs found"); throw std::runtime_error("No MoMs found");
// Find index of source MoM in MoMoM // Find index of source MoM in MoMoM
int nIndex; int nIndex;
for (nIndex=0; nIndex<moms.size(); nIndex++) { for (nIndex=0; nIndex<moms.size(); nIndex++) {
@ -277,7 +277,7 @@ TxProof GetAssetchainProof(uint256 hash)
}; };
if (!ScanNotarisationsFromHeight(blockIndex->nHeight, isTarget, nota)) if (!ScanNotarisationsFromHeight(blockIndex->nHeight, isTarget, nota))
throw std::runtime_error("backnotarisation not yet confirmed"); 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;
} }
@ -291,7 +291,7 @@ TxProof GetAssetchainProof(uint256 hash)
} }
bool fMutated; bool fMutated;
BuildMerkleTree(&fMutated, leaves, tree); BuildMerkleTree(&fMutated, leaves, tree);
branch = GetMerkleBranch(nIndex, leaves.size(), tree); branch = GetMerkleBranch(nIndex, leaves.size(), tree);
// Check branch // Check branch
uint256 ourResult = SafeCheckMerkleBranch(blockIndex->hashMerkleRoot, branch, nIndex); uint256 ourResult = SafeCheckMerkleBranch(blockIndex->hashMerkleRoot, branch, nIndex);
@ -330,7 +330,7 @@ TxProof GetAssetchainProof(uint256 hash)
} }
// Check the proof // 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"); throw std::runtime_error("Failed validating MoM");
// All done! // All done!

2
src/komodo_notary.h

@ -19,7 +19,7 @@
#include "komodo_cJSON.h" #include "komodo_cJSON.h"
//include "notaries_STAKED.h" //include "notaries_STAKED.h"
//{"kmdcrazy", "02da444a2627d420f1f622fcdfb9bddb67d6d4241ad6b4d5054716ddbde8a25dfb"} // RJPJBbHcm5mkAxhkkERHRfEE9Cvkr4Euoi
const char *notaries_STAKED[][2] = const char *notaries_STAKED[][2] =
{ {
{"blackjok3r", "021914947402d936a89fbdd1b12be49eb894a1568e5e17bb18c8a6cffbd3dc106e" }, // RTVti13NP4eeeZaCCmQxc2bnPdHxCJFP9x {"blackjok3r", "021914947402d936a89fbdd1b12be49eb894a1568e5e17bb18c8a6cffbd3dc106e" }, // RTVti13NP4eeeZaCCmQxc2bnPdHxCJFP9x

9
src/main.cpp

@ -3375,6 +3375,15 @@ bool static DisconnectTip(CValidationState &state, bool fBare = false) {
CBlock block; CBlock block;
if (!ReadBlockFromDisk(block, pindexDelete,1)) if (!ReadBlockFromDisk(block, pindexDelete,1))
return AbortNode(state, "Failed to read block"); return AbortNode(state, "Failed to read block");
{
int32_t prevMoMheight; uint256 notarizedhash,txid;
komodo_notarized_height(&prevMoMheight,&notarizedhash,&txid);
if ( block.GetHash() == notarizedhash )
{
fprintf(stderr,"DisconnectTip trying to disconnect notarized block at ht.%d\n",(int32_t)pindexDelete->nHeight);
return(false);
}
}
// Apply the block atomically to the chain state. // Apply the block atomically to the chain state.
uint256 anchorBeforeDisconnect = pcoinsTip->GetBestAnchor(); uint256 anchorBeforeDisconnect = pcoinsTip->GetBestAnchor();
int64_t nStart = GetTimeMicros(); int64_t nStart = GetTimeMicros();

5
src/notarisationdb.cpp

@ -47,6 +47,11 @@ NotarisationsInBlock ScanBlockNotarisations(const CBlock &block, int nHeight)
return vNotarisations; return vNotarisations;
} }
bool IsTXSCL(const char* symbol)
{
return strlen(symbol) >= 5 && strncmp(symbol, "TXSCL", 5) == 0;
}
bool GetBlockNotarisations(uint256 blockHash, NotarisationsInBlock &nibs) bool GetBlockNotarisations(uint256 blockHash, NotarisationsInBlock &nibs)
{ {

2
src/rpcblockchain.cpp

@ -820,7 +820,7 @@ UniValue kvsearch(const UniValue& params, bool fHelp)
"}\n" "}\n"
"\nExamples:\n" "\nExamples:\n"
+ HelpExampleCli("kvsearch", "examplekey") + HelpExampleCli("kvsearch", "examplekey")
+ HelpExampleRpc("kvsearch", "examplekey") + HelpExampleRpc("kvsearch", "\"examplekey\"")
); );
LOCK(cs_main); LOCK(cs_main);
if ( (keylen= (int32_t)strlen(params[0].get_str().c_str())) > 0 ) if ( (keylen= (int32_t)strlen(params[0].get_str().c_str())) > 0 )

2
src/rpcmining.cpp

@ -915,7 +915,7 @@ UniValue getblocksubsidy(const UniValue& params, bool fHelp)
"}\n" "}\n"
"\nExamples:\n" "\nExamples:\n"
+ HelpExampleCli("getblocksubsidy", "1000") + HelpExampleCli("getblocksubsidy", "1000")
+ HelpExampleRpc("getblockubsidy", "1000") + HelpExampleRpc("getblocksubsidy", "1000")
); );
LOCK(cs_main); LOCK(cs_main);

10
src/wallet/rpcwallet.cpp

@ -542,7 +542,7 @@ UniValue kvupdate(const UniValue& params, bool fHelp)
"}\n" "}\n"
"\nExamples:\n" "\nExamples:\n"
+ HelpExampleCli("kvupdate", "examplekey \"examplevalue\" 2 examplepassphrase") + HelpExampleCli("kvupdate", "examplekey \"examplevalue\" 2 examplepassphrase")
+ HelpExampleRpc("kvupdate", "examplekey \"examplevalue\" 2 examplepassphrase") + HelpExampleRpc("kvupdate", "\"examplekey\",\"examplevalue\",\"2\",\"examplepassphrase\"")
); );
if (!EnsureWalletIsAvailable(fHelp)) if (!EnsureWalletIsAvailable(fHelp))
return 0; return 0;
@ -1252,13 +1252,13 @@ UniValue sendmany(const UniValue& params, bool fHelp)
" the number of addresses.\n" " the number of addresses.\n"
"\nExamples:\n" "\nExamples:\n"
"\nSend two amounts to two different addresses:\n" "\nSend two amounts to two different addresses:\n"
+ HelpExampleCli("sendmany", "\"\" \"{\\\"RD6GgnrMpPaTSMn8vai6yiGA7mN4QGPV\\\":0.01,\\\"RD6GgnrMpPaTSMn8vai6yiGA7mN4QGPV\\\":0.02}\"") + + HelpExampleCli("sendmany", "\"\" \"{\\\"RD6GgnrMpPaTSMn8vai6yiGA7mN4QGPVMY\\\":0.01,\\\"RRyyejME7LRTuvdziWsXkAbSW1fdiohGwK\\\":0.02}\"") +
"\nSend two amounts to two different addresses setting the confirmation and comment:\n" "\nSend two amounts to two different addresses setting the confirmation and comment:\n"
+ HelpExampleCli("sendmany", "\"\" \"{\\\"RD6GgnrMpPaTSMn8vai6yiGA7mN4QGPV\\\":0.01,\\\"RD6GgnrMpPaTSMn8vai6yiGA7mN4QGPV\\\":0.02}\" 6 \"testing\"") + + HelpExampleCli("sendmany", "\"\" \"{\\\"RD6GgnrMpPaTSMn8vai6yiGA7mN4QGPVMY\\\":0.01,\\\"RRyyejME7LRTuvdziWsXkAbSW1fdiohGwK\\\":0.02}\" 6 \"testing\"") +
"\nSend two amounts to two different addresses, subtract fee from amount:\n" "\nSend two amounts to two different addresses, subtract fee from amount:\n"
+ HelpExampleCli("sendmany", "\"\" \"{\\\"RD6GgnrMpPaTSMn8vai6yiGA7mN4QGPV\\\":0.01,\\\"RD6GgnrMpPaTSMn8vai6yiGA7mN4QGPV\\\":0.02}\" 1 \"\" \"[\\\"RD6GgnrMpPaTSMn8vai6yiGA7mN4QGPV\\\",\\\"RD6GgnrMpPaTSMn8vai6yiGA7mN4QGPV\\\"]\"") + + HelpExampleCli("sendmany", "\"\" \"{\\\"RD6GgnrMpPaTSMn8vai6yiGA7mN4QGPVMY\\\":0.01,\\\"RRyyejME7LRTuvdziWsXkAbSW1fdiohGwK\\\":0.02}\" 1 \"\" \"[\\\"RD6GgnrMpPaTSMn8vai6yiGA7mN4QGPVMY\\\",\\\"RRyyejME7LRTuvdziWsXkAbSW1fdiohGwK\\\"]\"") +
"\nAs a json rpc call\n" "\nAs a json rpc call\n"
+ HelpExampleRpc("sendmany", "\"\", \"{\\\"RD6GgnrMpPaTSMn8vai6yiGA7mN4QGPV\\\":0.01,\\\"RD6GgnrMpPaTSMn8vai6yiGA7mN4QGPV\\\":0.02}\", 6, \"testing\"") + HelpExampleRpc("sendmany", "\"\", {\"RD6GgnrMpPaTSMn8vai6yiGA7mN4QGPVMY\":0.01,\"RRyyejME7LRTuvdziWsXkAbSW1fdiohGwK\":0.02}, 6, \"testing\"")
); );
if ( ASSETCHAINS_PRIVATE != 0 ) if ( ASSETCHAINS_PRIVATE != 0 )
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "cant use transparent addresses in private chain"); throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "cant use transparent addresses in private chain");

Loading…
Cancel
Save