QStrings=QInputDialog::getText(nullptr,"Master password","Enter your MASTER account password.",QLineEdit::Password,QString());
if(m_keyManager.load(s.toStdString()))
opened=true;
elseif(QMessageBox::question(
nullptr,
"Invalid password entered",
"The password you entered is incorrect. If you have forgotten your password, and you wish to start afresh, manually remove the file: "+QString::fromStdString(getDataDir("ethereum"))+"/keys.info",
QMessageBox::Retry,
QMessageBox::Abort)
==QMessageBox::Abort)
exit(0);
}
if(!opened)
{
QStringpassword;
while(true)
{
password=QInputDialog::getText(nullptr,"Master password","Enter a MASTER password for your key store. Make it strong. You probably want to write it down somewhere and keep it safe and secure; your identity will rely on this - you never want to lose it.",QLineEdit::Password,QString());
QStringconfirm=QInputDialog::getText(nullptr,"Master password","Confirm this password by typing it again",QLineEdit::Password,QString());
if(password==confirm)
break;
QMessageBox::warning(nullptr,"Try again","You entered two different passwords - please enter the same password twice.",QMessageBox::Ok);
returnQInputDialog::getText(const_cast<Main*>(this),"Import Account Key",QString("Enter the password for the account %2 (%1). The hint is:\n%3").arg(QString::fromStdString(_a.abridged())).arg(QString::fromStdString(info.first)).arg(QString::fromStdString(info.second)),QLineEdit::Password).toStdString();
}))
returns;
elseif(QMessageBox::warning(const_cast<Main*>(this),"Incorrect Password","The password you gave is incorrect for this key.",QMessageBox::Retry,QMessageBox::Cancel)==QMessageBox::Cancel)
QStringconfirm=QInputDialog::getText(nullptr,QString::fromStdString(_title),"Confirm this password by typing it again",QLineEdit::Password,QString());
if(password==confirm)
break;
QMessageBox::warning(nullptr,QString::fromStdString(_title),"You entered two different passwords - please enter the same password twice.",QMessageBox::Ok);
QStrings=QInputDialog::getText(this,"Import Account Key","Enter this account's name");
if(QMessageBox::question(this,"Additional Security?","Would you like to use additional security for this key? This lets you protect it with a different password to other keys, but also means you must re-enter the key's password every time you wish to use the account.",QMessageBox::Yes,QMessageBox::No)==QMessageBox::Yes)
{
std::stringpassword=getPassword("Import Account Key","Enter the password you would like to use for this key. Don't forget it!");
std::stringhint=QInputDialog::getText(this,"Import Account Key","Enter a hint to help you remember this password.").toStdString();
QStrings=QInputDialog::getText(this,"Create Account","Enter this account's name");
if(QMessageBox::question(this,"Create Account","Would you like to use additional security for this key? This lets you protect it with a different password to other keys, but also means you must re-enter the key's password every time you wish to use the account.",QMessageBox::Yes,QMessageBox::No)==QMessageBox::Yes)
{
std::stringpassword=getPassword("Create Account","Enter the password you would like to use for this key. Don't forget it!");
std::stringhint=QInputDialog::getText(this,"Create Account","Enter a hint to help you remember this password.").toStdString();
QString::fromStdString("Account "+render(k.address())+" has "+formatBalance(ethereum()->balanceAt(k.address()))+" in it. It, and any contract that this account can access, will be lost forever if you continue. Do NOT continue unless you know what you are doing.\n"
QString::fromStdString("Account "+k.first+" ("+render(h)+") has "+formatBalance(ethereum()->balanceAt(h))+" in it. It, and any contract that this account can access, will be lost forever if you continue. Do NOT continue unless you know what you are doing.\n"
returnshowAuthenticationPopup("Contract Creation Transaction",string("ÐApp is attemping to create a contract; ")+(_toProxy?"(this transaction is not executed directly, but forwarded to another ÐApp) ":"")+"to be endowed with "+formatBalance(_t.value)+", with additional network fees of up to "+formatBalance(_t.gas*_t.gasPrice)+".\n\nMaximum total cost is "+formatBalance(_t.value+_t.gas*_t.gasPrice)+".");
returnshowAuthenticationPopup("Fund Transfer Transaction","ÐApp is attempting to send "+formatBalance(_t.value)+" to a recipient "+m_main->pretty(_t.to)+(_toProxy?" (this transaction is not executed directly, but forwarded to another ÐApp)":"")+
", with additional network fees of up to "+formatBalance(_t.gas*_t.gasPrice)+".\n\nMaximum total cost is "+formatBalance(_t.value+_t.gas*_t.gasPrice)+".");
mutableboost::shared_mutexm_lock;///< General lock.
std::set<h256>m_drainingSet;///< All blocks being imported.
std::set<h256>m_readySet;///< All blocks ready for chain-import.
std::vector<std::pair<h256,bytes>>m_ready;///< List of blocks, in correct order, ready for chain-import.
std::set<h256>m_unknownSet;///< Set of all blocks whose parents are not ready/in-chain.
std::multimap<h256,std::pair<h256,bytes>>m_unknown;///< For blocks that have an unknown parent; we map their parent hash to the block stuff, and insert once the block appears.
std::set<h256>m_knownBad;///< Set of blocks that we know will never be valid.
std::multimap<unsigned,std::pair<h256,bytes>>m_future;///< Set of blocks that are not yet valid.
Signalm_onReady;///< Called when a subsequent call to import blocks will return a non-empty container. Be nice and exit fast.
mutableboost::shared_mutexm_lock;///< General lock.
h256Hashm_drainingSet;///< All blocks being imported.
h256Hashm_readySet;///< All blocks ready for chain-import.
std::vector<std::pair<h256,bytes>>m_ready;///< List of blocks, in correct order, ready for chain-import.
h256Hashm_unknownSet;///< Set of all blocks whose parents are not ready/in-chain.
std::unordered_multimap<h256,std::pair<h256,bytes>>m_unknown;///< For blocks that have an unknown parent; we map their parent hash to the block stuff, and insert once the block appears.
h256Hashm_knownBad;///< Set of blocks that we know will never be valid.
std::multimap<unsigned,std::pair<h256,bytes>>m_future;///< Set of blocks that are not yet valid. Ordered by timestamp
Signalm_onReady;///< Called when a subsequent call to import blocks will return a non-empty container. Be nice and exit fast.
// Find great-uncles (or second-cousins or whatever they are) - children of great-grandparents, great-great-grandparents... that were not already uncles in previous generations.
/// Execute the given block, assuming it corresponds to m_currentBlock.
/// Throws on failure.
@ -355,10 +354,10 @@ private:
SecureTrieDB<Address,OverlayDB>m_state;///< Our state tree, as an OverlayDB DB.
Transactionsm_transactions;///< The current list of transactions that we've included in the state.
TransactionReceiptsm_receipts;///< The corresponding list of transaction receipts.
std::set<h256>m_transactionSet;///< The set of transaction hashes that we've included in the state.
h256Hashm_transactionSet;///< The set of transaction hashes that we've included in the state.
OverlayDBm_lastTx;
mutablestd::map<Address,Account>m_cache;///< Our address cache. This stores the states of each address that has (or at least might have) been changed.
mutablestd::unordered_map<Address,Account>m_cache;///< Our address cache. This stores the states of each address that has (or at least might have) been changed.
BlockInfom_previousBlock;///< The previous block's information.
BlockInfom_currentBlock;///< The current block's information.
std::set<h256>m_known;///< Hashes of transactions in both sets.
std::map<h256,Transaction>m_current;///< Map of SHA3(tx) to tx.
std::multimap<Address,std::pair<h256,Transaction>>m_unknown;///< For transactions that have a future nonce; we map their sender address to the tx stuff, and insert once the sender has a valid TX.
std::map<h256,std::function<void(ImportResult)>>m_callbacks;///< Called once.
std::set<h256>m_dropped;///< Transactions that have previously been dropped.
std::multimap<Address,h256>m_senders;///< Mapping from the sender address to the transaction hash; useful for determining the nonce of a given sender.
Signalm_onReady;///< Called when a subsequent call to import transactions will return a non-empty container. Be nice and exit fast.
mutableSharedMutexm_lock;///< General lock.
h256Hashm_known;///< Hashes of transactions in both sets.
std::unordered_map<h256,Transaction>m_current;///< Map of SHA3(tx) to tx.
std::unordered_multimap<Address,std::pair<h256,Transaction>>m_unknown;///< For transactions that have a future nonce; we map their sender address to the tx stuff, and insert once the sender has a valid TX.
std::unordered_map<h256,std::function<void(ImportResult)>>m_callbacks;///< Called once.
h256Hashm_dropped;///< Transactions that have previously been dropped.
std::multimap<Address,h256>m_senders;///< Mapping from the sender address to the transaction hash; useful for determining the nonce of a given sender.
Signalm_onReady;///< Called when a subsequent call to import transactions will return a non-empty container. Be nice and exit fast.