Skip to content

Commit

Permalink
back out calling base constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
jmjatlanta committed Feb 1, 2022
1 parent 8a3764d commit 71b3f3e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
21 changes: 10 additions & 11 deletions src/komodo_notary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,9 @@ const notarized_checkpoint *komodo_npptr(int32_t height)
{
char symbol[KOMODO_ASSETCHAIN_MAXLEN];
char dest[KOMODO_ASSETCHAIN_MAXLEN];
komodo_state *sp;

if ( (sp= komodo_stateptr(symbol,dest)) != nullptr )
komodo_state *sp = komodo_stateptr(symbol, dest);
if ( sp != nullptr )
{
return sp->CheckpointAtHeight(height);
}
Expand All @@ -311,9 +311,9 @@ int32_t komodo_prevMoMheight()
{
char symbol[KOMODO_ASSETCHAIN_MAXLEN];
char dest[KOMODO_ASSETCHAIN_MAXLEN];
komodo_state *sp;

if ( (sp= komodo_stateptr(symbol,dest)) != nullptr )
komodo_state *sp = komodo_stateptr(symbol,dest);
if ( sp != nullptr )
{
return sp->PrevMoMHeight();
}
Expand All @@ -331,13 +331,13 @@ int32_t komodo_notarized_height(int32_t *prevMoMheightp,uint256 *hashp,uint256 *
{
char symbol[KOMODO_ASSETCHAIN_MAXLEN];
char dest[KOMODO_ASSETCHAIN_MAXLEN];
komodo_state *sp;

*prevMoMheightp = 0;
memset(hashp,0,sizeof(*hashp));
memset(txidp,0,sizeof(*txidp));

if ( (sp= komodo_stateptr(symbol,dest)) != nullptr )
komodo_state *sp = komodo_stateptr(symbol, dest);
if ( sp != nullptr )
{
return sp->NotarizedHeight(prevMoMheightp, hashp, txidp);
}
Expand Down Expand Up @@ -397,16 +397,15 @@ int32_t komodo_MoMdata(int32_t *notarized_htp,uint256 *MoMp,uint256 *kmdtxidp,in
*/
int32_t komodo_notarizeddata(int32_t nHeight,uint256 *notarized_hashp,uint256 *notarized_desttxidp)
{
int32_t i=0;
bool found = false;
char symbol[KOMODO_ASSETCHAIN_MAXLEN];
char dest[KOMODO_ASSETCHAIN_MAXLEN];
komodo_state *sp;
char dest[KOMODO_ASSETCHAIN_MAXLEN];

if ( (sp= komodo_stateptr(symbol,dest)) != nullptr )
komodo_state *sp = komodo_stateptr(symbol,dest);
if ( sp != nullptr )
{
return sp->NotarizedData(nHeight, notarized_hashp, notarized_desttxidp);
}

memset(notarized_hashp,0,sizeof(*notarized_hashp));
memset(notarized_desttxidp,0,sizeof(*notarized_desttxidp));
return 0;
Expand Down
5 changes: 2 additions & 3 deletions src/komodo_structs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,15 @@ std::ostream& operator<<(std::ostream& os, const event& in)
* @param pos the starting position (will advance)
* @param data_len full length of data
*/
event_pubkeys::event_pubkeys(uint8_t* data, long& pos, long data_len, int32_t height) : event_pubkeys(height)
event_pubkeys::event_pubkeys(uint8_t* data, long& pos, long data_len, int32_t height) : event(EVENT_PUBKEYS, height)
{
num = data[pos++];
if (num > 64)
throw parse_error("Illegal number of keys: " + std::to_string(num));
mem_nread(pubkeys, num, data, pos, data_len);
}

event_pubkeys::event_pubkeys(FILE* fp, int32_t height) : event_pubkeys(height)
event_pubkeys::event_pubkeys(FILE* fp, int32_t height) : event(EVENT_PUBKEYS, height)
{
num = fgetc(fp);
if ( fread(pubkeys,33,num,fp) != num )
Expand Down Expand Up @@ -478,7 +478,6 @@ const notarized_checkpoint *komodo_state::CheckpointAtHeight(int32_t height) con
{
// find the nearest notarization_height
// work backwards, get the first one that meets our criteria
auto itr = NPOINTS.rbegin();
for(auto itr = NPOINTS.rbegin(); itr != NPOINTS.rend(); ++itr)
{
if ( itr->MoMdepth != 0
Expand Down
2 changes: 1 addition & 1 deletion src/uint256.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class uint160 : public base_blob<160> {
*/
class uint256 : public base_blob<256> {
public:
uint256() : base_blob<256>() {}
uint256() {}
uint256(const base_blob<256>& b) : base_blob<256>(b) {}
explicit uint256(const std::vector<unsigned char>& vch) : base_blob<256>(vch) {}

Expand Down

0 comments on commit 71b3f3e

Please sign in to comment.