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)
{
{
m_myKeys.append(k);
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("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)":"")+
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)+".");
", with additional network fees of up to "+formatBalance(_t.gas*_t.gasPrice)+".\n\nMaximum total cost is "+formatBalance(_t.value+_t.gas*_t.gasPrice)+".");
/// Convert u256 into user-readable string. Returns int/hex value of 64 bits int, hex of 160 bits FixedHash. As a fallback try to handle input as h256.
/// Convert u256 into user-readable string. Returns int/hex value of 64 bits int, hex of 160 bits FixedHash. As a fallback try to handle input as h256.
std::stringprettyU256(u256_n,bool_abridged=true);
std::stringprettyU256(u256_n,bool_abridged=true);
externconstu256UndefinedU256;
}
}
@ -59,18 +57,6 @@ namespace dev
namespaceeth
namespaceeth
{
{
structTransactionSkeleton
{
boolcreation=false;
Addressfrom;
Addressto;
u256value;
bytesdata;
u256gas=UndefinedU256;
u256gasPrice=UndefinedU256;
};
/// Convert to a block number, a bit like jsToInt, except that it correctly recognises "pending" and "latest".
/// Convert to a block number, a bit like jsToInt, except that it correctly recognises "pending" and "latest".