move cross chain choose to staked.cpp
This commit is contained in:
@@ -13,8 +13,6 @@ typedef struct CrosschainAuthority {
|
|||||||
size_t requiredSigs;
|
size_t requiredSigs;
|
||||||
} CrosschainAuthority;
|
} CrosschainAuthority;
|
||||||
|
|
||||||
CrosschainAuthority auth_STAKED_chosen(const char *notaries_chosen[][2],int num_notaries);
|
|
||||||
|
|
||||||
int GetSymbolAuthority(const char* symbol);
|
int GetSymbolAuthority(const char* symbol);
|
||||||
bool CheckTxAuthority(const CTransaction &tx, CrosschainAuthority auth);
|
bool CheckTxAuthority(const CTransaction &tx, CrosschainAuthority auth);
|
||||||
|
|
||||||
|
|||||||
@@ -53,15 +53,7 @@ bool CheckTxAuthority(const CTransaction &tx, CrosschainAuthority auth)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
CrosschainAuthority auth_STAKED_chosen(const char *notaries_chosen[][2],int num_notaries){
|
|
||||||
CrosschainAuthority auth;
|
|
||||||
auth.requiredSigs = (num_notaries / 5);
|
|
||||||
auth.size = num_notaries;
|
|
||||||
for (int n=0; n<auth.size; n++)
|
|
||||||
for (size_t i=0; i<33; i++)
|
|
||||||
sscanf(notaries_chosen[n][1]+(i*2), "%2hhx", auth.notaries[n]+i);
|
|
||||||
return auth;
|
|
||||||
};
|
|
||||||
/*
|
/*
|
||||||
const CrosschainAuthority auth_STAKED = [&](){
|
const CrosschainAuthority auth_STAKED = [&](){
|
||||||
CrosschainAuthority auth;
|
CrosschainAuthority auth;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
|
|
||||||
#include "notaries_staked.h"
|
#include "notaries_staked.h"
|
||||||
|
#include "crosschain.h"
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
// Era 1 set of pubkeys
|
// Era 1 set of pubkeys
|
||||||
@@ -121,3 +122,13 @@ int STAKED_era(int timestamp)
|
|||||||
// if we are in a gap, return era 0, so any notarizations submitted are invalid.
|
// if we are in a gap, return era 0, so any notarizations submitted are invalid.
|
||||||
return(era);
|
return(era);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CrosschainAuthority auth_STAKED_chosen(const char *notaries_chosen[][2],int num_notaries){
|
||||||
|
CrosschainAuthority auth;
|
||||||
|
auth.requiredSigs = (num_notaries / 5);
|
||||||
|
auth.size = num_notaries;
|
||||||
|
for (int n=0; n<auth.size; n++)
|
||||||
|
for (size_t i=0; i<33; i++)
|
||||||
|
sscanf(notaries_chosen[n][1]+(i*2), "%2hhx", auth.notaries[n]+i);
|
||||||
|
return auth;
|
||||||
|
};
|
||||||
|
|||||||
@@ -24,4 +24,7 @@ extern int num_notaries_STAKED4;
|
|||||||
int is_STAKED(const char *chain_name);
|
int is_STAKED(const char *chain_name);
|
||||||
int STAKED_era(int timestamp);
|
int STAKED_era(int timestamp);
|
||||||
|
|
||||||
|
CrosschainAuthority Choose_auth_STAKED(staked_era)
|
||||||
|
CrosschainAuthority auth_STAKED_chosen(const char *notaries_chosen[][2],int num_notaries);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -51,13 +51,6 @@ NotarisationsInBlock ScanBlockNotarisations(const CBlock &block, int nHeight)
|
|||||||
{
|
{
|
||||||
// era 1
|
// era 1
|
||||||
auth_STAKED = auth_STAKED_chosen(notaries_STAKED1,num_notaries_STAKED1);
|
auth_STAKED = auth_STAKED_chosen(notaries_STAKED1,num_notaries_STAKED1);
|
||||||
/*
|
|
||||||
auth_STAKED.requiredSigs = (num_notaries_STAKED1 / 5);
|
|
||||||
auth_STAKED.size = num_notaries_STAKED1;
|
|
||||||
for (int n=0; n<auth_STAKED.size; n++)
|
|
||||||
for (size_t i=0; i<33; i++)
|
|
||||||
sscanf(notaries_STAKED1[n][1]+(i*2), "%2hhx", auth_STAKED.notaries[n]+i);
|
|
||||||
*/
|
|
||||||
} else if (staked_era == 2)
|
} else if (staked_era == 2)
|
||||||
{
|
{
|
||||||
// era 2
|
// era 2
|
||||||
|
|||||||
Reference in New Issue
Block a user