try
This commit is contained in:
@@ -107,7 +107,7 @@ int is_STAKED(const char *chain_name) {
|
|||||||
STAKED = 2;
|
STAKED = 2;
|
||||||
else if ( (strcmp(chain_name, "CFEK") == 0) || (strncmp(chain_name, "CFEK", 4) == 0) )
|
else if ( (strcmp(chain_name, "CFEK") == 0) || (strncmp(chain_name, "CFEK", 4) == 0) )
|
||||||
STAKED = 3;
|
STAKED = 3;
|
||||||
fprintf(stderr, "This chains is: %s which is: %d\n", chain_name,STAKED);
|
//fprintf(stderr, "This chains is: %s which is: %d\n", chain_name,STAKED);
|
||||||
return(STAKED);
|
return(STAKED);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ bool CWallet::AddKeyPubKey(const CKey& secret, const CPubKey &pubkey)
|
|||||||
bool CWallet::AddCryptedKey(const CPubKey &vchPubKey,
|
bool CWallet::AddCryptedKey(const CPubKey &vchPubKey,
|
||||||
const vector<unsigned char> &vchCryptedSecret)
|
const vector<unsigned char> &vchCryptedSecret)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!CCryptoKeyStore::AddCryptedKey(vchPubKey, vchCryptedSecret))
|
if (!CCryptoKeyStore::AddCryptedKey(vchPubKey, vchCryptedSecret))
|
||||||
return false;
|
return false;
|
||||||
if (!fFileBacked)
|
if (!fFileBacked)
|
||||||
@@ -520,7 +520,7 @@ bool CWallet::Verify(const string& walletFile, string& warningString, string& er
|
|||||||
} catch (const boost::filesystem::filesystem_error&) {
|
} catch (const boost::filesystem::filesystem_error&) {
|
||||||
// failure is ok (well, not really, but it's not worse than what we started with)
|
// failure is ok (well, not really, but it's not worse than what we started with)
|
||||||
}
|
}
|
||||||
|
|
||||||
// try again
|
// try again
|
||||||
if (!bitdb.Open(GetDataDir())) {
|
if (!bitdb.Open(GetDataDir())) {
|
||||||
// if it still fails, it probably means we can't even create the database env
|
// if it still fails, it probably means we can't even create the database env
|
||||||
@@ -529,14 +529,14 @@ bool CWallet::Verify(const string& walletFile, string& warningString, string& er
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetBoolArg("-salvagewallet", false))
|
if (GetBoolArg("-salvagewallet", false))
|
||||||
{
|
{
|
||||||
// Recover readable keypairs:
|
// Recover readable keypairs:
|
||||||
if (!CWalletDB::Recover(bitdb, walletFile, true))
|
if (!CWalletDB::Recover(bitdb, walletFile, true))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (boost::filesystem::exists(GetDataDir() / walletFile))
|
if (boost::filesystem::exists(GetDataDir() / walletFile))
|
||||||
{
|
{
|
||||||
CDBEnv::VerifyResult r = bitdb.Verify(walletFile, CWalletDB::Recover);
|
CDBEnv::VerifyResult r = bitdb.Verify(walletFile, CWalletDB::Recover);
|
||||||
@@ -550,7 +550,7 @@ bool CWallet::Verify(const string& walletFile, string& warningString, string& er
|
|||||||
if (r == CDBEnv::RECOVER_FAIL)
|
if (r == CDBEnv::RECOVER_FAIL)
|
||||||
errorString += _("wallet.dat corrupt, salvage failed");
|
errorString += _("wallet.dat corrupt, salvage failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1202,6 +1202,13 @@ bool CWallet::UpdatedNoteData(const CWalletTx& wtxIn, CWalletTx& wtx)
|
|||||||
*/
|
*/
|
||||||
bool CWallet::AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pblock, bool fUpdate)
|
bool CWallet::AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pblock, bool fUpdate)
|
||||||
{
|
{
|
||||||
|
int64_t totalvoutvalue = 0;
|
||||||
|
for (size_t i = 0; i < tx.vout.size() ; i++) {
|
||||||
|
totalvoutvalue = totalvoutvalue + tx.vout[i].nValue;
|
||||||
|
fprintf(stderr, "total: %ld \nvout %d = %ld", totalvoutvalue, i, tx.vout[i].nValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
//if ( IsFromMe(tx) && tx.vout[0].value )
|
||||||
{
|
{
|
||||||
AssertLockHeld(cs_wallet);
|
AssertLockHeld(cs_wallet);
|
||||||
bool fExisted = mapWallet.count(tx.GetHash()) != 0;
|
bool fExisted = mapWallet.count(tx.GetHash()) != 0;
|
||||||
@@ -2296,7 +2303,7 @@ void CWallet::AvailableCoins(vector<COutput>& vCoins, bool fOnlyConfirmed, const
|
|||||||
int nDepth = pcoin->GetDepthInMainChain();
|
int nDepth = pcoin->GetDepthInMainChain();
|
||||||
if (nDepth < 0)
|
if (nDepth < 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
for (unsigned int i = 0; i < pcoin->vout.size(); i++)
|
for (unsigned int i = 0; i < pcoin->vout.size(); i++)
|
||||||
{
|
{
|
||||||
isminetype mine = IsMine(pcoin->vout[i]);
|
isminetype mine = IsMine(pcoin->vout[i]);
|
||||||
@@ -2642,7 +2649,7 @@ bool CWallet::FundTransaction(CMutableTransaction& tx, CAmount &nFeeRet, int& nC
|
|||||||
|
|
||||||
CReserveKey reservekey(this);
|
CReserveKey reservekey(this);
|
||||||
CWalletTx wtx;
|
CWalletTx wtx;
|
||||||
|
|
||||||
if (!CreateTransaction(vecSend, wtx, reservekey, nFeeRet, nChangePosRet, strFailReason, &coinControl, false))
|
if (!CreateTransaction(vecSend, wtx, reservekey, nFeeRet, nChangePosRet, strFailReason, &coinControl, false))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -2708,7 +2715,7 @@ bool CWallet::CreateTransaction(const vector<CRecipient>& vecSend, CWalletTx& wt
|
|||||||
txNew.nExpiryHeight = nextBlockHeight + expiryDelta;
|
txNew.nExpiryHeight = nextBlockHeight + expiryDelta;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
LOCK2(cs_main, cs_wallet);
|
LOCK2(cs_main, cs_wallet);
|
||||||
{
|
{
|
||||||
@@ -3194,7 +3201,7 @@ bool CWallet::SetDefaultKey(const CPubKey &vchPubKey)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Mark old keypool keys as used,
|
* Mark old keypool keys as used,
|
||||||
* and generate all new keys
|
* and generate all new keys
|
||||||
*/
|
*/
|
||||||
bool CWallet::NewKeyPool()
|
bool CWallet::NewKeyPool()
|
||||||
{
|
{
|
||||||
@@ -3902,7 +3909,7 @@ void CWallet::GetFilteredNotes(
|
|||||||
if (ignoreUnspendable && !HaveSpendingKey(pa)) {
|
if (ignoreUnspendable && !HaveSpendingKey(pa)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// skip locked notes
|
// skip locked notes
|
||||||
if (IsLockedNote(jsop.hash, jsop.js, jsop.n)) {
|
if (IsLockedNote(jsop.hash, jsop.js, jsop.n)) {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user