fix
This commit is contained in:
@@ -811,9 +811,11 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//fprintf(stderr,"%s connect.%d\n",ASSETCHAINS_SYMBOL,pindex->nHeight);
|
//fprintf(stderr,"%s connect.%d\n",ASSETCHAINS_SYMBOL,pindex->nHeight);
|
||||||
if ( is_STAKED(ASSETCHAINS_SYMBOL) != 0 || IS_STAKED_NOTARY != -1 ) {
|
if ( is_STAKED(ASSETCHAINS_SYMBOL) != 0 )
|
||||||
|
{
|
||||||
staked_era = STAKED_era(pindex->GetBlockTime());
|
staked_era = STAKED_era(pindex->GetBlockTime());
|
||||||
if ( staked_era != lastStakedEra ) {
|
if ( staked_era != lastStakedEra )
|
||||||
|
{
|
||||||
uint8_t tmp_pubkeys[64][33];
|
uint8_t tmp_pubkeys[64][33];
|
||||||
int8_t numSN = numStakedNotaries(tmp_pubkeys,staked_era);
|
int8_t numSN = numStakedNotaries(tmp_pubkeys,staked_era);
|
||||||
UpdateNotaryAddrs(tmp_pubkeys,numSN);
|
UpdateNotaryAddrs(tmp_pubkeys,numSN);
|
||||||
|
|||||||
@@ -64,6 +64,14 @@ extern uint32_t ASSETCHAINS_MAGIC;
|
|||||||
extern uint64_t ASSETCHAINS_ENDSUBSIDY,ASSETCHAINS_REWARD,ASSETCHAINS_HALVING,ASSETCHAINS_DECAY,ASSETCHAINS_COMMISSION,ASSETCHAINS_STAKED,ASSETCHAINS_SUPPLY;
|
extern uint64_t ASSETCHAINS_ENDSUBSIDY,ASSETCHAINS_REWARD,ASSETCHAINS_HALVING,ASSETCHAINS_DECAY,ASSETCHAINS_COMMISSION,ASSETCHAINS_STAKED,ASSETCHAINS_SUPPLY;
|
||||||
extern std::string NOTARY_PUBKEY,NOTARY_ADDRESS; extern uint8_t NOTARY_PUBKEY33[];
|
extern std::string NOTARY_PUBKEY,NOTARY_ADDRESS; extern uint8_t NOTARY_PUBKEY33[];
|
||||||
|
|
||||||
|
UniValue getiguanajson(const UniValue& params, bool fHelp)
|
||||||
|
{
|
||||||
|
if ( params.size() != 1 )
|
||||||
|
throw runtime_error("please supply old staked.json!\n");
|
||||||
|
UniValue json = params[0].get_obj();
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
UniValue getinfo(const UniValue& params, bool fHelp)
|
UniValue getinfo(const UniValue& params, bool fHelp)
|
||||||
{
|
{
|
||||||
uint256 notarized_hash,notarized_desttxid; int32_t prevMoMheight,notarized_height,longestchain,kmdnotarized_height,txid_height;
|
uint256 notarized_hash,notarized_desttxid; int32_t prevMoMheight,notarized_height,longestchain,kmdnotarized_height,txid_height;
|
||||||
|
|||||||
@@ -263,6 +263,7 @@ static const CRPCCommand vRPCCommands[] =
|
|||||||
/* Overall control/query calls */
|
/* Overall control/query calls */
|
||||||
{ "control", "getinfo", &getinfo, true }, /* uses wallet if enabled */
|
{ "control", "getinfo", &getinfo, true }, /* uses wallet if enabled */
|
||||||
{ "control", "help", &help, true },
|
{ "control", "help", &help, true },
|
||||||
|
{ "control", "getiguanajson", &getiguanajson, true },
|
||||||
{ "control", "stop", &stop, true },
|
{ "control", "stop", &stop, true },
|
||||||
|
|
||||||
/* P2P networking */
|
/* P2P networking */
|
||||||
|
|||||||
@@ -324,6 +324,7 @@ extern UniValue walletlock(const UniValue& params, bool fHelp);
|
|||||||
extern UniValue encryptwallet(const UniValue& params, bool fHelp);
|
extern UniValue encryptwallet(const UniValue& params, bool fHelp);
|
||||||
extern UniValue validateaddress(const UniValue& params, bool fHelp);
|
extern UniValue validateaddress(const UniValue& params, bool fHelp);
|
||||||
extern UniValue getinfo(const UniValue& params, bool fHelp);
|
extern UniValue getinfo(const UniValue& params, bool fHelp);
|
||||||
|
extern UniValue getiguanajson(const UniValue& params, bool fHelp);
|
||||||
extern UniValue setpubkey(const UniValue& params, bool fHelp);
|
extern UniValue setpubkey(const UniValue& params, bool fHelp);
|
||||||
extern UniValue getwalletinfo(const UniValue& params, bool fHelp);
|
extern UniValue getwalletinfo(const UniValue& params, bool fHelp);
|
||||||
extern UniValue getblockchaininfo(const UniValue& params, bool fHelp);
|
extern UniValue getblockchaininfo(const UniValue& params, bool fHelp);
|
||||||
|
|||||||
@@ -1061,6 +1061,11 @@ UniValue cleanwallettransactions(const UniValue& params, bool fHelp)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// get all locked utxos to relock them later.
|
||||||
|
vector<COutPoint> vLockedUTXO;
|
||||||
|
pwalletMain->ListLockedCoins(vLockedUTXO);
|
||||||
|
// unlock all coins so that the following call containes all utxos.
|
||||||
|
pwalletMain->UnlockAllCoins();
|
||||||
// listunspent call... this gets us all the txids that are unspent, we search this list for the oldest tx,
|
// listunspent call... this gets us all the txids that are unspent, we search this list for the oldest tx,
|
||||||
vector<COutput> vecOutputs;
|
vector<COutput> vecOutputs;
|
||||||
assert(pwalletMain != NULL);
|
assert(pwalletMain != NULL);
|
||||||
@@ -1072,6 +1077,10 @@ UniValue cleanwallettransactions(const UniValue& params, bool fHelp)
|
|||||||
oldestTxDepth = out.nDepth;
|
oldestTxDepth = out.nDepth;
|
||||||
}
|
}
|
||||||
oldestTxDepth = oldestTxDepth + 1; // add extra block just for safety.
|
oldestTxDepth = oldestTxDepth + 1; // add extra block just for safety.
|
||||||
|
// lock all the previouly locked coins.
|
||||||
|
BOOST_FOREACH(COutPoint &outpt, vLockedUTXO) {
|
||||||
|
pwalletMain->LockCoin(outpt);
|
||||||
|
}
|
||||||
|
|
||||||
// then add all txs in the wallet before this block to the list to remove.
|
// then add all txs in the wallet before this block to the list to remove.
|
||||||
for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
|
for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
|
||||||
|
|||||||
Reference in New Issue
Block a user