예제 #1
0
// WalletModel::UnlockContext implementation
WalletModel::UnlockContext WalletModel::requestUnlock()
{
    bool was_locked = getEncryptionStatus() == Locked;
    if(was_locked)
    {
        // Request UI to unlock wallet
        emit requireUnlock();
    }
    // If wallet is still locked, unlock was failed or cancelled, mark context as invalid
    bool valid = getEncryptionStatus() != Locked;

    return UnlockContext(this, valid, was_locked);
}
예제 #2
0
void WalletModel::updateStatus()
{
    EncryptionStatus newEncryptionStatus = getEncryptionStatus();

    if(cachedEncryptionStatus != newEncryptionStatus)
        emit encryptionStatusChanged(newEncryptionStatus);
}
예제 #3
0
void WalletModel::update()
{
	qint64 newBalance = getBalance();
	qint64 newUnconfirmedBalance = getUnconfirmedBalance();
	int newNumTransactions = getNumTransactions();
	EncryptionStatus newEncryptionStatus = getEncryptionStatus();
	bool newMintStatus = getMintUnlockedbool();
        qint64 newReserveBalance = getCoinStakeReserveValue();

	if (cachedBalance != newBalance || cachedUnconfirmedBalance != newUnconfirmedBalance)
		emit balanceChanged(newBalance, getStake(), newUnconfirmedBalance);

	if (cachedNumTransactions != newNumTransactions)
		emit numTransactionsChanged(newNumTransactions);

	if (cachedEncryptionStatus != newEncryptionStatus)
		emit encryptionStatusChanged(newEncryptionStatus);
        
	if (cachedMintStatus != newMintStatus)
		emit mintStatusChanged(newMintStatus,newReserveBalance);

	cachedBalance = newBalance;
	cachedUnconfirmedBalance = newUnconfirmedBalance;
	cachedNumTransactions = newNumTransactions;
	cachedMintStatus = newMintStatus;
        cachedReserveBalance = newReserveBalance;
}
예제 #4
0
파일: walletmodel.cpp 프로젝트: DevAoD/AoD
void WalletModel::update()
{
    qint64 newBalance = getBalance();
    qint64 newUnconfirmedBalance = getUnconfirmedBalance();
    int newNumTransactions = getNumTransactions();
    EncryptionStatus newEncryptionStatus = getEncryptionStatus();

    if(cachedBalance != newBalance || cachedUnconfirmedBalance != newUnconfirmedBalance)
        emit balanceChanged(newBalance, getStake(), newUnconfirmedBalance);

    if(cachedNumTransactions != newNumTransactions)
        emit numTransactionsChanged(newNumTransactions);

    if(cachedEncryptionStatus != newEncryptionStatus)
        emit encryptionStatusChanged(newEncryptionStatus);

    cachedBalance = newBalance;
    cachedUnconfirmedBalance = newUnconfirmedBalance;
    cachedNumTransactions = newNumTransactions;
}