Merge branch 'jl777-dev' into dev

x
This commit is contained in:
blackjok3r
2019-04-20 22:52:39 +08:00
6 changed files with 43 additions and 20 deletions

2
src/ac/koin Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/bash
./komodo-cli -ac_name=KOIN $1 $2 $3 $4 $5 $6

View File

@@ -237,8 +237,8 @@
"217.182.129.38",
"37.187.225.231"
]
},
{
},
{
"ac_name": "ILN",
"ac_supply": "10000000000",
"ac_cc": "2",
@@ -258,10 +258,15 @@
"ac_cc": "3",
"addnode": ["138.201.136.145"]
},
{
{
"ac_name": "VOTE2019",
"ac_supply": "123651638",
"ac_public": "1",
"addnode": ["95.213.238.98"]
},
{
"ac_name": "KOIN",
"ac_supply": "125000000",
"addnode": ["3.0.32.10"]
}
]

View File

@@ -50,3 +50,4 @@ echo $pubkey
./komodod -pubkey=$pubkey -ac_name=RICK -ac_supply=90000000000 -ac_reward=100000000 -ac_cc=3 -addnode=138.201.136.145 &
./komodod -pubkey=$pubkey -ac_name=MORTY -ac_supply=90000000000 -ac_reward=100000000 -ac_cc=3 -addnode=138.201.136.145 &
./komodod -pubkey=$pubkey -ac_name=VOTE2019 -ac_supply=123651638 -ac_public=1 -addnode=95.213.238.98 &
./komodod -pubkey=$pubkey -ac_name=KOIN -ac_supply=125000000 -addnode=3.0.32.10 &

View File

@@ -197,7 +197,7 @@ int64_t OracleCurrentDatafee(uint256 reforacletxid,char *markeraddr,CPubKey publ
{
uint256 txid,oracletxid,hashBlock; int64_t datafee=0,dfee; int32_t dheight=0,vout,height,numvouts; CTransaction tx; CPubKey pk;
std::vector<std::pair<CAddressUnspentKey, CAddressUnspentValue> > unspentOutputs;
SetCCunspents(unspentOutputs,markeraddr,true);
SetCCunspents(unspentOutputs,markeraddr,false);
for (std::vector<std::pair<CAddressUnspentKey, CAddressUnspentValue> >::const_iterator it=unspentOutputs.begin(); it!=unspentOutputs.end(); it++)
{
txid = it->first.txhash;
@@ -306,7 +306,7 @@ uint256 OraclesBatontxid(uint256 reforacletxid,CPubKey refpk)
batontxid = zeroid;
cp = CCinit(&C,EVAL_ORACLES);
CCtxidaddr(markeraddr,reforacletxid);
SetCCunspents(unspentOutputs,markeraddr,true);
SetCCunspents(unspentOutputs,markeraddr,false);
//char str[67]; fprintf(stderr,"markeraddr.(%s) %s\n",markeraddr,pubkey33_str(str,(uint8_t *)&refpk));
for (std::vector<std::pair<CAddressUnspentKey, CAddressUnspentValue> >::const_iterator it=unspentOutputs.begin(); it!=unspentOutputs.end(); it++)
{
@@ -532,7 +532,7 @@ int32_t oracleprice_add(std::vector<struct oracleprice_info> &publishers,CPubKey
if ( format[0] != 'L' )
return(0);
cp = CCinit(&C,EVAL_ORACLES);
SetCCunspents(unspentOutputs,markeraddr,true);
SetCCunspents(unspentOutputs,markeraddr,false);
for (std::vector<std::pair<CAddressUnspentKey, CAddressUnspentValue> >::const_iterator it=unspentOutputs.begin(); it!=unspentOutputs.end(); it++)
{
txid = it->first.txhash;
@@ -992,7 +992,7 @@ UniValue OracleInfo(uint256 origtxid)
result.push_back(Pair("description",description));
result.push_back(Pair("format",format));
result.push_back(Pair("marker",markeraddr));
SetCCunspents(unspentOutputs,markeraddr,true);
SetCCunspents(unspentOutputs,markeraddr,false);
for (std::vector<std::pair<CAddressUnspentKey, CAddressUnspentValue> >::const_iterator it=unspentOutputs.begin(); it!=unspentOutputs.end(); it++)
{
txid = it->first.txhash;

2
src/fiat/koin Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/bash
./komodo-cli -ac_name=KOIN $1 $2 $3 $4 $5 $6

View File

@@ -30,6 +30,7 @@
#include "utiltime.h"
#include "wallet/wallet.h"
#include "zcash/Proof.hpp"
#include "komodo_defs.h"
#include <boost/filesystem.hpp>
#include <boost/foreach.hpp>
@@ -486,7 +487,6 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue,
auto verifier = libzcash::ProofVerifier::Strict();
if (!(CheckTransaction(0,wtx, state, verifier) && (wtx.GetHash() == hash) && state.IsValid()))
{
fprintf(stderr, "Removing corrupt tx from wallet.%s\n", hash.ToString().c_str());
deadTxns.push_back(hash);
return false;
}
@@ -951,22 +951,35 @@ DBErrors CWalletDB::LoadWallet(CWallet* pwallet)
result = DB_CORRUPT;
}
if (!deadTxns.empty())
if ( !deadTxns.empty() )
{
int32_t reAdded = 0;
BOOST_FOREACH (uint256& hash, deadTxns) {
if (!EraseTx(hash))
fprintf(stderr, "could not delete tx.%s\n",hash.ToString().c_str());
uint256 blockhash; CTransaction tx;
if (GetTransaction(hash,tx,blockhash,true))
if ( ASSETCHAINS_STAKED != 0 )
{
int32_t reAdded = 0;
CWalletDB walletdb(pwallet->strWalletFile, "r+", false);
BOOST_FOREACH (uint256& hash, deadTxns)
{
CWalletTx wtx(pwallet,tx);
pwallet->AddToWallet(wtx, false, NULL);
reAdded++;
fprintf(stderr, "Removing corrupt tx from wallet.%s\n", hash.ToString().c_str());
if (!EraseTx(hash))
fprintf(stderr, "could not delete tx.%s\n",hash.ToString().c_str());
uint256 blockhash; CTransaction tx;
if (GetTransaction(hash,tx,blockhash,true))
{
CWalletTx wtx(pwallet,tx);
pwallet->AddToWallet(wtx, false, &walletdb);
reAdded++;
}
}
fprintf(stderr, "Cleared %lu corrupted transactions from wallet. Readded %i known transactions.\n",(long)deadTxns.size(),reAdded);
fNoncriticalErrors = false;
deadTxns.clear();
}
else if ( (GetBoolArg("-zapwallettxes", false)) )
{
LogPrintf("Transactions are corrupted. Please restart daemon with -zapwallettxes=2\n");
fprintf(stderr,"Transactions are corrupted. Please restart daemon with -zapwallettxes=2\n");
return DB_CORRUPT;
}
fprintf(stderr, "Cleared %lu corrupted transactions from wallet. Readded %i known transactions.\n",(long)deadTxns.size(),reAdded);
deadTxns.clear();
}
if (fNoncriticalErrors && result == DB_LOAD_OK)