From 49713d8a0441d233998ea763576dec42a1bd89c0 Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Tue, 14 Sep 2021 16:00:08 -0400 Subject: [PATCH] Various things --- src/hush_bitcoind.h | 10 +++--- src/hush_defs.h | 75 ++++++++++++++++++++++++++++++++++++++++-- src/hush_globals.h | 2 +- src/hush_notary.h | 24 +++++++++++--- src/main.cpp | 3 +- src/rpc/crosschain.cpp | 45 +++++++------------------ src/rpc/server.cpp | 4 ++- 7 files changed, 114 insertions(+), 49 deletions(-) diff --git a/src/hush_bitcoind.h b/src/hush_bitcoind.h index bf53316db..e2b4e9fa7 100644 --- a/src/hush_bitcoind.h +++ b/src/hush_bitcoind.h @@ -868,18 +868,18 @@ int32_t hush_minerids(uint8_t *minerids,int32_t height,int32_t width) return(nonz); } -int32_t hush_MoM(int32_t *notarized_heightp,uint256 *MoMp,uint256 *kmdtxidp,int32_t nHeight,uint256 *MoMoMp,int32_t *MoMoMoffsetp,int32_t *MoMoMdepthp,int32_t *kmdstartip,int32_t *kmdendip) +int32_t hush_MoM(int32_t *notarized_heightp,uint256 *MoMp,uint256 *hushtxidp,int32_t nHeight,uint256 *MoMoMp,int32_t *MoMoMoffsetp,int32_t *MoMoMdepthp,int32_t *kmdstartip,int32_t *kmdendip) { - int32_t depth,notarized_ht; uint256 MoM,kmdtxid; - depth = hush_MoMdata(¬arized_ht,&MoM,&kmdtxid,nHeight,MoMoMp,MoMoMoffsetp,MoMoMdepthp,kmdstartip,kmdendip); + int32_t depth,notarized_ht; uint256 MoM,hushtxid; + depth = hush_MoMdata(¬arized_ht,&MoM,&hushtxid,nHeight,MoMoMp,MoMoMoffsetp,MoMoMdepthp,kmdstartip,kmdendip); memset(MoMp,0,sizeof(*MoMp)); - memset(kmdtxidp,0,sizeof(*kmdtxidp)); + memset(hushtxidp,0,sizeof(*hushtxidp)); *notarized_heightp = 0; if ( depth != 0 && notarized_ht > 0 && nHeight > notarized_ht-depth && nHeight <= notarized_ht ) { *MoMp = MoM; *notarized_heightp = notarized_ht; - *kmdtxidp = kmdtxid; + *hushtxidp = hushtxid; } return(depth); } diff --git a/src/hush_defs.h b/src/hush_defs.h index 8fa2024ee..c88abe9d6 100644 --- a/src/hush_defs.h +++ b/src/hush_defs.h @@ -53,13 +53,15 @@ const uint32_t nHushHardforkHeight = 166250; const uint32_t nHushHardforkHeight2 = 245055; // This height begins Hush DPoW from Hush notaries -const uint32_t nHushHardforkHeight3 = 340420; - -// No coins/code are currently using timestamp activated fork +const uint32_t nHushHardforkHeight3 = 340420; const uint32_t nHushHardforkTimestamp = 1580303652; // Jan 29nd 1pm GMT const uint32_t nHushHardforkTimestamp2 = 1594425600; // Jul 11th 12a GMT +// Used by HSCs static const uint32_t HUSH_SEASON_TIMESTAMPS[NUM_HUSH_SEASONS] = {1525132800, 1563148800, nHushHardforkTimestamp, nHushHardforkTimestamp2, nHushHardforkTimestamp2*5, nHushHardforkTimestamp2*6, nHushHardforkTimestamp2*7}; + +// Used by HUSH3+TUSH +// Block 1702100 = nHushHardforkHeight3*5 static const int32_t HUSH_SEASON_HEIGHTS[NUM_HUSH_SEASONS] = {1,2,nHushHardforkHeight, nHushHardforkHeight2, (int)340000, nHushHardforkHeight3, nHushHardforkHeight3*5}; // Era array of pubkeys. Add extra seasons to bottom as requried, after adding appropriate info above. @@ -472,6 +474,73 @@ static const char *notaries_elected[NUM_HUSH_SEASONS][NUM_HUSH_NOTARIES][2] = {"RAJWHL6MzGFKg7KB2sZ87KPQUSvxy3VrEW", "0389971362b002ab5dfa1b5f9c4f88e68249511a3935242ba1e0d31c1c88a36d70"}, {"RU592tQnbH8gt6xd5Uu23nEw3SucDNkXmK", "02b8b6a2266fe57b25f2d4b1da93a07d27930154e78f9d137bc7509cf1ae8e3d49"}, {"RLGCLRzaEmruPC9UmVt5qRHEhXwHip1e6d", "02a2fd96b4459411ad2b09597ba59cf52b282c56330da7c0cc6d2a5c0323a18f1e"} + }, + { + // season 7 + {"RFetqf8WUfWnwNeXdknkm8ojk7EXnYFzrv", "038a1bd41a08f38edda51042988022933c5775dfce81f7bae0b32a9179650352ac"}, + {"RV7YSVW89WC9jBDtFG4ubtopDRove4Tfvc", "03c9d35488be73fe4f2dbb1dc011468482d71bac32249f8cce6480bcc574415d19"}, + {"RBPFE9oXceZBWTn3Vhne4FUKE9vxGEXUKX", "028a8bb6ded2692b39a69ec2d3c9836ff221815909d5cd65257374aeb66394a002"}, + {"RM3cvUcafPhjyypZLEginQjdhjLnSgJHte", "03a36180014115b47b97c1c8776a269bba66047b1ce2c7eb1a3d4e995a6dfff0df"}, + {"RFFX1VaTmZYPBLCzFj7w3iJQArV9ZdaWcW", "02190865f3ca3678d322c96e49a3ddf8ad394a4c8cd97d4bb3376cf547d0d83c66"}, + {"RDwZsLpH1QiAbJwUEY8ajXwTzu3PaWhx7n", "023ea0babb34e1ff9f4db8131ee84ad8991b954038a1e6ef9afc2a1b3fa13bbcb9"}, + {"RCUvfnmt16ZMvLTmLGGAztcAE8fBjfbP6u", "0379a5ba9fb6b463ffcdc0b1f3ecf45a5b737275354f9c2598492f20660f6f7dfd"}, + {"RBLu9adNVMVf6jzLLbAenWovcwq8nU6gYd", "022cd69381231d69d6d3b9638762df849bc7bbab71cbb8383eec29ca677f1afa30"}, + {"RWfv6wd2fwgecnJxC1Ykpf1SJefGh2Wc6i", "03da8a8f57d88afb61f712a8cd35462b65ce2b2575db8f9ee33a725dcd12c44755"}, + {"RWiK4xooG3dPdvaovu6JvR3DWoYD4tfRjx", "02ffe66af4d71345fe6984b5002ad69206e1817566a70d9ac406a679be6a3335a0"}, + {"RYLNiJiRnEGeMxx1Q2xLoFujshRNkBa2x4", "028ef6501004569c1170ce2d7ec7ecfe5739001130ad1b39129f8b88cd3d610257"}, + {"RTw36Ksy5Wk1Xv3B53T79zoRd6XDsE9MS6", "02d7cf4ece00895ca857fcdd0a4c2fc9c949a518d2750396f77d9f031c08a94364"}, + {"RTPkUBriQzZy67WmFhEs6aQzJn5HBB3ntb", "03319ca1eae5888c45115d160ac07c4f2abd1720926aa579d535c4b46c807bb7f7"}, + {"RBmZzttvDnMaEv47cWXs8SgdC993djB68r", "034302c4e1ff72a5f5391f259f7a46e646c7845aa2c9de9fb0c0a4c4802aad79d6"}, + {"RGocb2jLCa2E9kVHDUsijrVGTDP82ngGYZ", "024440a18a16e38b836b3ad9bb54ab0b5ba83b04edebb58c62c09b2de29e9fc703"}, + {"RVqwCjPQ6AJ6r9WeGzQvAT4eGXDScprLkW", "028a94e53ad8ed9e78f0f8a87cf3bc4754784222ad7ddf2d3dc5fafec2f6891cde"}, + {"RB2Xc8eLrATRWVsxrZKHHx3hyJz1vugMt9", "02eca07a9b5810fe929a87f90e5f02e29a06479d39cd3a888abfa1793e1565155a"}, + {"RKm7WUuFfqCTiUBkbxBsdh54nT6ivXpDPX", "03e3f634671005c8ffb7fe883fcf9e08f6f5486df057f215d761741d91c88de898"}, + {"RLbHTvFQoz946W3o3gXTrjxxADeUsWWW16", "02e6bb6dcecf5e3abfe239dec55842a92f096eeac7f0ff7621c3e8948e5e789b27"}, + {"RD75njr2RLGC5PqjHbWwuL7ndTqZiUfYxs", "0250d9996c25a34cb1b4e86303a297fc5c49c65615eb31a57fb17d1e1b376e71be"}, + {"RT1VTzZYZLWUsPWFJ2oypEqB1MXMfq8b5Y", "02d1797941b7df42a98f59ede0f22294e7c02754232a8b1de9512ededaf3f82880"}, + {"RKeXriTVXioHeKpFTjC8Cjohd6DHGUcKqt", "0341e62f0cdffc4ba3e0efb793c0fcaaad1b611db7021b844f643d5c25847733d2"}, + {"RQYrDEgZPKMFAgTHNkWFeMHEmpkXe8j28T", "02b8719cd8484755990158cbdf7b9d990d4a5c3741cabe204e51ed04be5bd50133"}, + {"RE85TACcn8CEn26itAxQV9afxV9mVg17vm", "0367f569d3dc304e699196fe9b798671fe3f12df7851a0a474879b0dbf8bc508d1"}, + {"RPYWQJXto1aeCGe8T6g9Wo4tAL4xE82LJ8", "02cf1e245dfb44e418fd550abb825a600e1753d46a51995970e70c98be539da33e"}, + {"RSVHRS5wqEw7bxfuE9k6xJGbARcy5guisp", "03ab8ac83d689ce76b5d29a54c3b34d0a6cb37d64313ff4467c744787475969a23"}, + {"REAQwBaJFo6DyBkwfW7rTTDbUtkdmATcQ8", "025e80f0075514cc5940de85c0c559efa99a3688faf6cccb8c1d1f38b96ca91e71"}, + {"RF1gz8QBw5uFScGasqVxoUjQwJCD9zHJwC", "031cdae4b545e5049ccee8e0cb792e25795b56e08b5e64b1d972c9b94e9bfd4ed0"}, + {"RTnLGoWzpsyoGSViGH8GyYcYhSveSEmnPV", "03cf3403a9d1cefa83e07b73e618a7f991d140a8283a02df3ce7c00223f27f43d0"}, + {"RArURqxp6qfF7fqv38tCYr6p4zBtLtqf4x", "026bc4c91c2c35fabe88fea6470d6cda98977a97c251656adf25b81653c00c3800"}, + {"RN8GCryShNFvBWtcNEWrQJ5A9AWb3JJoXt", "02afa94f6574cd0fe4f5dc83b09a2112457862421ce96bdc75c1cf25ef5b1f8c4b"}, + {"RQSC2eBckcFPWzq9UtofePC31wgDySfJtw", "035d570768d844c8150a3bd966a2e13aa99316f4ab3e80370c4d16fb02f95d0974"}, + {"RC4uQsfH6jXpgnTFuFiDwAFo58gHLNkWo7", "02402b0ab7001fd4bcb4fa0d8d7006a6c521b1c76e85aad7b374ecd6c5d564c237"}, + {"RREcuaUWSkNzTNPBbFLbXKTKiC4fd5t47J", "03d5bf8b43c44ba064e897da47dd36dba537bebf013d28247ce7a088496dd9b66d"}, + {"REFyC5e7kmse3PUapDuXHL2xmtYEGttYYL", "035f56fd01dd21725928bbd878b795dccafecc03b978dc83748e9194dcbfebfb79"}, + {"RH1BLwZosLp2hv9msdZGdSu93K8GrMWw7D", "0224ab22ece88f624f80a8535b8d5194646ad6be749070ec188a22c5e29fdd7098"}, + {"RNkhugMQVbqDysSayHu2eAhTQpXzKWqZ3m", "02caab4c83c8cc245a7aeb6d25504363555d1b0874aef0f9f8116b4ddb61f24799"}, + {"RKiyhLELDJATA7ZCUcutkP1WCEHnAgZRZ8", "028c01859a700ed3941a5786cf2043992e17a45c6689ac4bf608ad3f19e6d0e832"}, + {"RLKARvLNo6Abkh5qh5NVn2HJmYfj8ELa6A", "0300a33629da90b9d3c0519d796f4b1278355bb8c46e4caee04b1305e2ab2ff3f2"}, + {"RACX21FKLenyyEf8SYK3LmjsDzkDthwUbR", "0205d73c6a3e969eff29e5f424c861d22544245e09eaafc3fefe021cad052b7c0b"}, + {"RETb7pEDauKBEuTBuXDhKS3ksd2p8x9KYa", "025c1f7596fd0b7286e6ebd1b3c275a14a13aa4d134db4677769324969b7b7e3a5"}, + {"RJrAo78TL6zUmiHXbBv8oRhfGKxGnPnxUu", "02d40a76fbab96a78898b7579626be6dfe360c63b91030e513f849f212d57c1af6"}, + {"RL8g6ANxhZBPHHHWgApaiSQ2BSP9qKwuwf", "020236a5748ea49da891276bcb85dc03487cb9f3d0c2b2cdb35227b6a624f86797"}, + {"RY3vwBjuuTCiYL5am9HmwbdCjffWd9f4CE", "032f61fd08957d9b88dabc077d8732bef6c30d0234c14e02f3a741116834f591dc"}, + {"RQW4LsSzjCPtNw1HGamSaCoiirvsrZmDY5", "02e29451f9baf0186a655396726a22a20617a3e54ea895590f6066abc993f83d32"}, + {"RJtjorxqhazz39UpFdhDW8MiW4E3jhXDNk", "03795b7a650db872c22f13a9c88ad5c1ad3cb07a349f1f29e9789efd27e151164b"}, + {"RSi8AiCCtS3doFupdpdfuorAhkrCS6mLMu", "037a62ff6b7eb2ba1e170b5c42e7788817ded6a3a7ed841321c01cc107aa647d42"}, + {"RMjMXC8m9PgAaMMvwqgLCyCrv47pp6F6XY", "033bdf151c01bc733e614f9d4f204ca44396bf56984df6643205d349a35f7b265d"}, + {"RYB3ZMgHt4h7YL8TUzpqaSDw22ABksAPGC", "021266e045f95322fceddae02877dca9721792bef8f2be28cacd7c36290cd813a7"}, + {"RGwy64PXswUKpiepfzgaRW98v3gsuqPtow", "03008783c34c2622e7167f0a5201846133e530e89dfe1a8fbcf4c29b33051c4565"}, + {"RKJRPLaQV4AkWF6EfUUzFwawTGU4RQZgcS", "03c20a9fd21de76a20ffc87e384be735dfabb7f34a2d881ca9714830fb1bbe6bdb"}, + {"RQ4SPvBKTEKyV6y31iSihtfMxi3KeyAJgV", "033c5a23c75d946c15c15fac1e6d78e08c2b656549a158627cfb6bc44bb7b3a560"}, + {"RTvRBC1pCQpPKrS27Q4hUCVKVpa5tSTsFS", "02c25672fae388a0613d0127fcfe38ef37f5f354ecfdea0fb734528e354319bd9d"}, + {"RKxWu9HpCg7m3UeUGw2Xs1SpFiR96fSCQj", "02ec760d09b369b82b34d864af5a468d8a7dc5609b06bce455d045d1059c4b0f71"}, + {"RBAaUWAD8jwVLL7ueb7ciAQewqgheKxwdk", "0274ec3abcca214cdf7f1a565f5f3d3fa910e62e751a1ab0de148ea14ba72d6ba7"}, + {"RT853SBEGt4EWrKbpSujya69DG1jSNYjob", "02e80260ca44b8539159e6af678cf5ed0bc596753e4985f66418d6417085b4104e"}, + {"RKjEuhVByPwJcZ9wuBgfELiCVnBrc4F8i4", "0357c38f5d5eb1662a54b980c9243ddd8b2100d4b2b9f8175246938ef76e100678"}, + {"RT6wVuFFPU5tY6C7Buup1GLV3SE5mpYEha", "02571085ead1aca86b9e90fa9a23d99a194c862524b0c714102888be5bf122dc7d"}, + {"RSTgcpV82AivrvWJpd4LR2KwWirwbwXE3Y", "021a0ee4611ca4d8a2e209cc43b95036deb0a9d1cc31fc9f87d50233a44f05ec1a"}, + {"RCiaXRzo4AAG3zmPL3Hx63NsRWv5UGiNuM", "02f4876be65c54613e47f7fac67f1453e8d8fde5e19fa53f278a1083a08b258ab3"}, + {"RCGgLWrTTaqBhUsS1BqrmFpJZAdNJMzscv", "02893d2db5329b15a33aa7edfbf323c85cabbdc25caa6cf6186fac6052ae6d96a0"}, + {"RAJWHL6MzGFKg7KB2sZ87KPQUSvxy3VrEW", "0389971362b002ab5dfa1b5f9c4f88e68249511a3935242ba1e0d31c1c88a36d70"}, + {"RU592tQnbH8gt6xd5Uu23nEw3SucDNkXmK", "02b8b6a2266fe57b25f2d4b1da93a07d27930154e78f9d137bc7509cf1ae8e3d49"}, + {"RLGCLRzaEmruPC9UmVt5qRHEhXwHip1e6d", "02a2fd96b4459411ad2b09597ba59cf52b282c56330da7c0cc6d2a5c0323a18f1e"} } }; diff --git a/src/hush_globals.h b/src/hush_globals.h index 12f4f7f65..605d78021 100644 --- a/src/hush_globals.h +++ b/src/hush_globals.h @@ -21,7 +21,7 @@ void hush_prefetch(FILE *fp); uint32_t hush_heightstamp(int32_t height); void hush_stateupdate(int32_t height,uint8_t notarypubs[][33],uint8_t numnotaries,uint8_t notaryid,uint256 txhash,uint64_t voutmask,uint8_t numvouts,uint32_t *pvals,uint8_t numpvals,int32_t kheight,uint32_t ktime,uint64_t opretvalue,uint8_t *opretbuf,uint16_t opretlen,uint16_t vout,uint256 MoM,int32_t MoMdepth); void hush_init(int32_t height); -int32_t hush_MoMdata(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 hush_MoMdata(int32_t *notarized_htp,uint256 *MoMp,uint256 *hushtxidp,int32_t nHeight,uint256 *MoMoMp,int32_t *MoMoMoffsetp,int32_t *MoMoMdepthp,int32_t *kmdstartip,int32_t *kmdendip); int32_t hush_notarizeddata(int32_t nHeight,uint256 *notarized_hashp,uint256 *notarized_desttxidp); char *hush_issuemethod(char *userpass,char *method,char *params,uint16_t port); void hush_init(int32_t height); diff --git a/src/hush_notary.h b/src/hush_notary.h index 610407df3..a8f792f8f 100644 --- a/src/hush_notary.h +++ b/src/hush_notary.h @@ -62,6 +62,19 @@ const char *Notaries_genesis[][2] = int32_t gethushseason(int32_t height) { + bool istush = strncmp(SMART_CHAIN_SYMBOL, "TUSH",4) == 0 ? true : false; + if ( istush ) { + // TUSH is always Season 7 DPoW notaries from genblock + return 7; + } + + // It is season 7 until a new consensus code change, instead + // of the old way, which requires a new code release before + // the last season block height or nodes stop working correctly + if ( height > nHushHardforkHeight3 ) { + return 7; + } + if ( height <= HUSH_SEASON_HEIGHTS[0] ) return(1); for (int32_t i = 1; i < NUM_HUSH_SEASONS; i++) @@ -89,6 +102,7 @@ int32_t hush_notaries(uint8_t pubkeys[64][33],int32_t height,uint32_t timestamp) int32_t i,htind,n; uint64_t mask = 0; struct knotary_entry *kp,*tmp; static uint8_t hush_pubkeys[NUM_HUSH_SEASONS][64][33],didinit[NUM_HUSH_SEASONS]; + //HUSH3+TUSH use block heights, HSCs use timestamps if ( timestamp == 0 && SMART_CHAIN_SYMBOL[0] != 0 ) { timestamp = hush_heightstamp(height); } else if ( SMART_CHAIN_SYMBOL[0] == 0 ) { @@ -98,7 +112,9 @@ int32_t hush_notaries(uint8_t pubkeys[64][33],int32_t height,uint32_t timestamp) // Find the correct DPoW Notary pubkeys for this season int32_t hush_season = 0; bool ishush3 = strncmp(SMART_CHAIN_SYMBOL, "HUSH3",5) == 0 ? true : false; - hush_season = ishush3 ? gethushseason(height) : getacseason(timestamp); + bool istush = strncmp(SMART_CHAIN_SYMBOL, "TUSH",4) == 0 ? true : false; + // TUSH uses height activation like HUSH3, other HSCs use timestamps + hush_season = (ishush3 || istush) ? gethushseason(height) : getacseason(timestamp); if(IS_HUSH_NOTARY) { fprintf(stderr,"%s: [%s] season=%d height=%d time=%d\n", __func__, ishush3 ? "HUSH3" : SMART_CHAIN_SYMBOL, hush_season, height, timestamp); @@ -323,14 +339,14 @@ int32_t hush_dpowconfs(int32_t txheight,int32_t numconfs) return(numconfs); } -int32_t hush_MoMdata(int32_t *notarized_htp,uint256 *MoMp,uint256 *kmdtxidp,int32_t height,uint256 *MoMoMp,int32_t *MoMoMoffsetp,int32_t *MoMoMdepthp,int32_t *kmdstartip,int32_t *kmdendip) +int32_t hush_MoMdata(int32_t *notarized_htp,uint256 *MoMp,uint256 *hushtxidp,int32_t height,uint256 *MoMoMp,int32_t *MoMoMoffsetp,int32_t *MoMoMdepthp,int32_t *kmdstartip,int32_t *kmdendip) { struct notarized_checkpoint *np = 0; if ( (np= komodo_npptr(height)) != 0 ) { *notarized_htp = np->notarized_height; *MoMp = np->MoM; - *kmdtxidp = np->notarized_desttxid; + *hushtxidp = np->notarized_desttxid; *MoMoMp = np->MoMoM; *MoMoMoffsetp = np->MoMoMoffset; *MoMoMdepthp = np->MoMoMdepth; @@ -341,7 +357,7 @@ int32_t hush_MoMdata(int32_t *notarized_htp,uint256 *MoMp,uint256 *kmdtxidp,int3 *notarized_htp = *MoMoMoffsetp = *MoMoMdepthp = *kmdstartip = *kmdendip = 0; memset(MoMp,0,sizeof(*MoMp)); memset(MoMoMp,0,sizeof(*MoMoMp)); - memset(kmdtxidp,0,sizeof(*kmdtxidp)); + memset(hushtxidp,0,sizeof(*hushtxidp)); return(0); } diff --git a/src/main.cpp b/src/main.cpp index 0771ffdb5..eabed2626 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1455,8 +1455,9 @@ bool CheckTransaction(uint32_t tiptime,const CTransaction& tx, CValidationState // This is used only in RPC currently but hush_notaries()/gethushseason/getacseason is consensus int32_t hush_isnotaryvout(char *coinaddr,uint32_t tiptime) { bool ishush3 = strncmp(SMART_CHAIN_SYMBOL, "HUSH3",5) == 0 ? true : false; + bool istush = strncmp(SMART_CHAIN_SYMBOL, "TUSH",4) == 0 ? true : false; int32_t height = chainActive.LastTip()->GetHeight(); - int32_t season = ishush3 ? gethushseason(height) : getacseason(tiptime); + int32_t season = (ishush3 || istush) ? gethushseason(height) : getacseason(tiptime); fprintf(stderr,"%s: season=%d, tiptime=%d\n", __func__, season,tiptime); if ( NOTARY_ADDRESSES[season-1][0][0] == 0 ) { uint8_t pubkeys[64][33]; diff --git a/src/rpc/crosschain.cpp b/src/rpc/crosschain.cpp index 45140138b..375bbfbd5 100644 --- a/src/rpc/crosschain.cpp +++ b/src/rpc/crosschain.cpp @@ -56,7 +56,7 @@ int32_t ensure_CCrequirements(uint8_t evalcode); bool EnsureWalletIsAvailable(bool avoidException); -int32_t hush_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 hush_MoM(int32_t *notarized_htp,uint256 *MoMp,uint256 *hushtxidp,int32_t nHeight,uint256 *MoMoMp,int32_t *MoMoMoffsetp,int32_t *MoMoMdepthp,int32_t *kmdstartip,int32_t *kmdendip); int32_t hush_MoMoMdata(char *hexstr,int32_t hexsize,struct hush_ccdataMoMoM *mdata,char *symbol,int32_t kmdheight,int32_t notarized_height); struct hush_ccdata_entry *komodo_allMoMs(int32_t *nump,uint256 *MoMoMp,int32_t kmdstarti,int32_t kmdendi); uint256 hush_calcMoM(int32_t height,int32_t MoMdepth); @@ -71,7 +71,7 @@ UniValue assetchainproof(const UniValue& params, bool fHelp, const CPubKey& mypk { uint256 hash; - // parse params and get notarisation data for tx + // parse params and get notarization data for tx if ( fHelp || params.size() != 1) throw runtime_error("assetchainproof needs a txid"); @@ -93,7 +93,7 @@ UniValue crosschainproof(const UniValue& params, bool fHelp, const CPubKey& mypk UniValue height_MoM(const UniValue& params, bool fHelp, const CPubKey& mypk) { - int32_t height,depth,notarized_height,MoMoMdepth,MoMoMoffset,kmdstarti,kmdendi; uint256 MoM,MoMoM,kmdtxid; uint32_t timestamp = 0; UniValue ret(UniValue::VOBJ); UniValue a(UniValue::VARR); + int32_t height,depth,notarized_height,MoMoMdepth,MoMoMoffset,kmdstarti,kmdendi; uint256 MoM,MoMoM,hushtxid; uint32_t timestamp = 0; UniValue ret(UniValue::VOBJ); UniValue a(UniValue::VARR); if ( fHelp || params.size() != 1 ) throw runtime_error("height_MoM height\n"); LOCK(cs_main); @@ -108,7 +108,7 @@ UniValue height_MoM(const UniValue& params, bool fHelp, const CPubKey& mypk) height = chainActive.Tip()->GetHeight(); } //fprintf(stderr,"height_MoM height.%d\n",height); - depth = hush_MoM(¬arized_height,&MoM,&kmdtxid,height,&MoMoM,&MoMoMoffset,&MoMoMdepth,&kmdstarti,&kmdendi); + depth = hush_MoM(¬arized_height,&MoM,&hushtxid,height,&MoMoM,&MoMoMoffset,&MoMoMdepth,&kmdstarti,&kmdendi); ret.push_back(Pair("coin",(char *)(SMART_CHAIN_SYMBOL[0] == 0 ? "HUSH" : SMART_CHAIN_SYMBOL))); ret.push_back(Pair("height",height)); ret.push_back(Pair("timestamp",(uint64_t)timestamp)); @@ -117,7 +117,7 @@ UniValue height_MoM(const UniValue& params, bool fHelp, const CPubKey& mypk) ret.push_back(Pair("depth",depth)); ret.push_back(Pair("notarized_height",notarized_height)); ret.push_back(Pair("MoM",MoM.GetHex())); - ret.push_back(Pair("kmdtxid",kmdtxid.GetHex())); + ret.push_back(Pair("hushtxid",hushtxid.GetHex())); if ( SMART_CHAIN_SYMBOL[0] != 0 ) { ret.push_back(Pair("MoMoM",MoMoM.GetHex())); @@ -134,18 +134,18 @@ UniValue height_MoM(const UniValue& params, bool fHelp, const CPubKey& mypk) UniValue MoMoMdata(const UniValue& params, bool fHelp, const CPubKey& mypk) { if ( fHelp || params.size() != 3 ) - throw runtime_error("MoMoMdata symbol kmdheight ccid\n"); + throw runtime_error("MoMoMdata symbol hushheight ccid\n"); UniValue ret(UniValue::VOBJ); char* symbol = (char *)params[0].get_str().c_str(); - int kmdheight = atoi(params[1].get_str().c_str()); + int hushheight = atoi(params[1].get_str().c_str()); uint32_t ccid = atoi(params[2].get_str().c_str()); ret.push_back(Pair("coin",symbol)); - ret.push_back(Pair("kmdheight",kmdheight-5)); + ret.push_back(Pair("hushheight",hushheight-5)); ret.push_back(Pair("ccid", (int) ccid)); uint256 destNotarizationTxid; std::vector moms; - uint256 MoMoM = CalculateProofRoot(symbol, ccid, kmdheight-5, moms, destNotarizationTxid); + uint256 MoMoM = CalculateProofRoot(symbol, ccid, hushheight-5, moms, destNotarizationTxid); UniValue valMoms(UniValue::VARR); for (int i=0; i 3) throw runtime_error("scanNotarizationsDB blockHeight symbol [blocksLimit=1440]\n\n" - "Scans notarisationsdb backwards from height for a notarisation" + "Scans notarizationsdb backwards from height for a notarization" " of given symbol"); int height = atoi(params[0].get_str().c_str()); std::string symbol = params[1].get_str().c_str(); diff --git a/src/rpc/server.cpp b/src/rpc/server.cpp index 8139c93ce..0046d4b7f 100644 --- a/src/rpc/server.cpp +++ b/src/rpc/server.cpp @@ -829,8 +829,10 @@ UniValue CRPCTable::execute(const std::string &strMethod, const UniValue ¶ms // Others may not have data loaded yet, such as wallet details, but // those RPCs are written defensively to deal with that. Allowing these // few RPCs means we can see our addresses and make private key backups - // while a very long wallet rescan is happening + // while a very long wallet rescan is happening and do other read-only devopz if (pcmd->name != "stop" && pcmd->name != "help" && pcmd->name != "z_listaddresses" && pcmd->name != "z_exportkey" && + pcmd->name != "getNotarizationsForBlock" && pcmd->name != "scanNotarizationsDB" && + pcmd->name != "getnotarysendmany" && pcmd->name != "geterablockheights" && pcmd->name != "getaddressesbyaccount" && pcmd->name != "listaddresses" && pcmd->name != "z_exportwallet" && pcmd->name != "notaries" && pcmd->name != "signmessage" && pcmd->name != "decoderawtransaction" && pcmd->name != "dumpprivkey" && pcmd->name != "getpeerinfo" && pcmd->name != "getnetworkinfo" ) {