Skip to content

Commit

Permalink
Update to TermRewards Logging
Browse files Browse the repository at this point in the history
  • Loading branch information
thesolarminer committed Mar 10, 2021
1 parent 0656902 commit fc4a2a4
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/smartrewards/rewards.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -726,40 +726,41 @@ void CSmartRewards::ProcessOutput(const CTransaction& tx, const CTxOut& out, uin
rTermEntry->expires = out.GetLockTime();
rTermEntry->balance = out.nValue;
}
LogPrintf("CSmartRewards::ProcessOutput: Output qualifies for %s TermRewards\n", rTermEntry->GetLevel());
LogPrintf("CSmartRewards::ProcessOutput: %s qualifies for %s SmartRetire\n", rTermEntry->ToString() ,rTermEntry->GetLevel());
} else if ( (out.GetLockTime() > (nTime + 63113904 - 2680000)) && (out.GetLockTime() < (nTime + 63113904 + 2680000)) ) { // 2 years within 1 month
if (GetTermRewardEntry({id, tx.GetHash()}, rTermEntry, true)) {
rTermEntry->level = CTermRewardEntry::TwoYears;
rTermEntry->percent = 40;
rTermEntry->expires = out.GetLockTime();
rTermEntry->balance = out.nValue;
}
LogPrintf("CSmartRewards::ProcessOutput: Output qualifies for %s TermRewards\n", rTermEntry->GetLevel());
LogPrintf("CSmartRewards::ProcessOutput: %s qualifies for %s SmartRetire\n", rTermEntry->ToString() ,rTermEntry->GetLevel());
} else if ( (out.GetLockTime() > (nTime + 94670856 - 2680000)) && (out.GetLockTime() < (nTime + 94670856 + 2680000)) ) { // 3 years within 1 month
if (GetTermRewardEntry({id, tx.GetHash()}, rTermEntry, true)) {
rTermEntry->level = CTermRewardEntry::ThreeYears;
rTermEntry->percent = 45;
rTermEntry->expires = out.GetLockTime();
rTermEntry->balance = out.nValue;
}
LogPrintf("CSmartRewards::ProcessOutput: Output qualifies for %s TermRewards\n", rTermEntry->GetLevel());
LogPrintf("CSmartRewards::ProcessOutput: %s qualifies for %s SmartRetire\n", rTermEntry->ToString() ,rTermEntry->GetLevel());
} else if ( (out.GetLockTime() > (nTime + 473354280 - 2680000)) && (out.GetLockTime() < (nTime + 473354280 + 2680000)) ) { // 15 years within 1 month
if (GetTermRewardEntry({id, tx.GetHash()}, rTermEntry, true)) {
rTermEntry->level = CTermRewardEntry::FifteenYears;
rTermEntry->percent = 50;
rTermEntry->expires = out.GetLockTime();
rTermEntry->balance = out.nValue;
}
LogPrintf("CSmartRewards::ProcessOutput: Output qualifies for %s SmartRetire\n", rTermEntry->GetLevel());
LogPrintf("CSmartRewards::ProcessOutput: %s qualifies for %s SmartRetire\n", rTermEntry->ToString() ,rTermEntry->GetLevel());
}
} else if (rEntry->id == CSmartAddress("8JqVJ84KeHLNfUg8qBHUkk98oALCytUXLE") && out.nValue >= 1000000 * COIN) {
if (GetTermRewardEntry({CSmartAddress("SdxQe3eBD7VrUQjd7iyXVjFWKm6GrRP6W9"), tx.GetHash()}, rTermEntry, true)) {
rTermEntry->level = CTermRewardEntry::FifteenYears;
rTermEntry->percent = 50;
rTermEntry->expires = 2111940508;
rTermEntry->expires = 2088527221;
rTermEntry->balance = out.nValue;
}
LogPrintf("CSmartRewards::ProcessOutput: Output qualifies for %s SmartRetire\n", rTermEntry->GetLevel());
LogPrintf("CSmartRewards::ProcessOutput: %s qualifies for %s SmartRetire\n", rTermEntry->ToString() ,rTermEntry->GetLevel());
LogPrintf("CSmartRewards::ProcessOutput: Converted from script %s \n", rEntry->ToString());
}

if (Is_1_3(nCurrentRound) && tx.IsCoinBase()) {
Expand Down

0 comments on commit fc4a2a4

Please sign in to comment.