コード例 #1
0
void WalletSerializer::loadCurrentVersion(Common::IInputStream& source, const std::string& password) {
  CryptoNote::CryptoContext cryptoContext;

  bool details = false;
  bool cache = false;

  loadIv(source, cryptoContext.iv);
  generateKey(password, cryptoContext.key);

  loadKeys(source, cryptoContext);
  checkKeys();

  loadWallets(source, cryptoContext);
  subscribeWallets();

  loadFlags(details, cache, source, cryptoContext);

  if (details) {
    loadTransactions(source, cryptoContext);
    loadTransfers(source, cryptoContext);
  }

  if (cache) {
    loadBalances(source, cryptoContext);
    loadTransfersSynchronizer(source, cryptoContext);
    loadSpentOutputs(source, cryptoContext);
    loadUnlockTransactionsJobs(source, cryptoContext);
    loadChange(source, cryptoContext);
  }

  if (details && cache) {
    updateTransactionsBaseStatus();
  }
}
void WalletSerializerV1::loadWallet(Common::IInputStream& source, const Crypto::chacha8_key& key, uint32_t version) {
  CryptoContext cryptoContext;

  bool details = false;
  bool cache = false;

  loadIv(source, cryptoContext.iv);
  cryptoContext.key = key;

  loadKeys(source, cryptoContext);
  checkKeys();

  loadWallets(source, cryptoContext);
  subscribeWallets();

  loadFlags(details, cache, source, cryptoContext);

  if (details) {
    loadTransactions(source, cryptoContext);
    loadTransfers(source, cryptoContext, version);
  }

  if (version < 5) {
    updateTransfersSign();
    cache = false;
  }

  if (cache) {
    loadBalances(source, cryptoContext);
    loadTransfersSynchronizer(source, cryptoContext);
    if (version < 5) {
      loadObsoleteSpentOutputs(source, cryptoContext);
    }

    loadUnlockTransactionsJobs(source, cryptoContext);

    if (version < 5) {
      loadObsoleteChange(source, cryptoContext);
    }

    if (version > 3) {
      loadUncommitedTransactions(source, cryptoContext);
    }
  } else {
    resetCachedBalance();
  }

  if (details && cache) {
    updateTransactionsBaseStatus();
  }
}
コード例 #3
0
void TransactionWidget::loadQuery()
{
        ThreadControl *tc = qobject_cast<ThreadControl *>( sender() );
        if( !tc )
            return;

        int i = tc->getIndexOfLastQuery( qList );
        if( i < 0 )
                return;

        QString str = tc->getData();

	switch(i)
	{
		case 0:
			{
				loadHeader( str );
				break;
			}
		case 1:
		case 4:
		case 5:
			{
				loadTransactions( str );
				break;
			}
		case 2:
			{
				clearTransaction( str );
				break;
			}
		case 3:
			{
				loadAccount( str );
				break;
			}
		case 6:
		case 7:
			{
				loadAccountSaldo( str );
				break;
			}
	}
}
コード例 #4
0
void WalletSerializerV2::load(Common::IInputStream& source, uint8_t version) {
  CryptoNote::BinaryInputStreamSerializer s(source);

  uint8_t saveLevelValue;
  s(saveLevelValue, "saveLevel");
  WalletSaveLevel saveLevel = static_cast<WalletSaveLevel>(saveLevelValue);

  loadKeyListAndBanalces(s, saveLevel == WalletSaveLevel::SAVE_ALL);

  if (saveLevel == WalletSaveLevel::SAVE_KEYS_AND_TRANSACTIONS || saveLevel == WalletSaveLevel::SAVE_ALL) {
    loadTransactions(s);
    loadTransfers(s);
  }

  if (saveLevel == WalletSaveLevel::SAVE_ALL) {
    loadTransfersSynchronizer(s);
    loadUnlockTransactionsJobs(s);
    s(m_uncommitedTransactions, "uncommitedTransactions");
  }

  s(m_extra, "extra");
}
コード例 #5
0
ファイル: cbinfo.cpp プロジェクト: opieproject/opie
// --- CBInfo -----------------------------------------------------------------
CBInfo::CBInfo( const QString &name, const QString &filename )
{
	Config config( filename, Config::File );
	config.setGroup( "Account" );

	n = name;
	fn = filename;
	pw = config.readEntryCrypt( "Password", QString::null );

	t = config.readEntry( "Type" );
	bn = config.readEntry( "Bank", "" );
	a = config.readEntryCrypt( "Number", "" );
	p = config.readEntryCrypt( "PINNumber", "" );
	nt = config.readEntry( "Notes", "" );
    _sLastTab = config.readEntry("LastTab", "");
    _first=config.readNumEntry("First", -1);
    _sSortOrder = config.readEntry( "SortOrder", QWidget::tr("Date") );

	bool ok;
	sb = config.readEntry( "Balance", "0.0" ).toFloat( &ok );

	loadTransactions();
}