diff options
author | s_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b> | 2010-10-09 19:33:35 +0000 |
---|---|---|
committer | s_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b> | 2010-10-09 19:33:35 +0000 |
commit | 103849419a9c014a69c76b6f96e48b66cbc838ca (patch) | |
tree | 73bce9b5c3d96304138b25d1e714222ea3d4a384 /ui.cpp | |
parent | 0a27bd065e4803a35e436c610bedb06fe39123c6 (diff) |
key pool for safer wallet backup
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@163 1a98c847-1fd6-4fd8-948a-caf3550aa51b
Diffstat (limited to 'ui.cpp')
-rw-r--r-- | ui.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -1170,7 +1170,7 @@ void CMainFrame::OnButtonNew(wxCommandEvent& event) string strName = dialog.GetValue(); // Generate new key - string strAddress = PubKeyToAddress(GenerateNewKey()); + string strAddress = PubKeyToAddress(CWalletDB().GetKeyFromKeyPool()); // Save SetAddressBookName(strAddress, strName); @@ -1425,7 +1425,10 @@ CTxDetailsDialog::CTxDetailsDialog(wxWindow* parent, CWalletTx wtx) : CTxDetails if (txout.IsMine()) strHTML += "<b>Credit:</b> " + FormatMoney(txout.GetCredit()) + "<br>"; - strHTML += "<b>Inputs:</b><br>"; + strHTML += "<br><b>Transaction:</b><br>"; + strHTML += HtmlEscape(wtx.ToString(), true); + + strHTML += "<br><b>Inputs:</b><br>"; CRITICAL_BLOCK(cs_mapWallet) { foreach(const CTxIn& txin, wtx.vin) @@ -1444,9 +1447,6 @@ CTxDetailsDialog::CTxDetailsDialog(wxWindow* parent, CWalletTx wtx) : CTxDetails } } } - - strHTML += "<br><hr><br><b>Transaction:</b><br>"; - strHTML += HtmlEscape(wtx.ToString(), true); } @@ -2245,9 +2245,9 @@ void CSendingDialog::OnReply2(CDataStream& vRecv) Error(_("Insufficient funds")); return; } - CKey key; + CReserveKey reservekey; int64 nFeeRequired; - if (!CreateTransaction(scriptPubKey, nPrice, wtx, key, nFeeRequired)) + if (!CreateTransaction(scriptPubKey, nPrice, wtx, reservekey, nFeeRequired)) { if (nPrice + nFeeRequired > GetBalance()) Error(strprintf(_("This is an oversized transaction that requires a transaction fee of %s"), FormatMoney(nFeeRequired).c_str())); @@ -2287,7 +2287,7 @@ void CSendingDialog::OnReply2(CDataStream& vRecv) return; // Commit - if (!CommitTransaction(wtx, key)) + if (!CommitTransaction(wtx, reservekey)) { Error(_("The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.")); return; @@ -2565,7 +2565,7 @@ void CAddressBookDialog::OnButtonNew(wxCommandEvent& event) strName = dialog.GetValue(); // Generate new key - strAddress = PubKeyToAddress(GenerateNewKey()); + strAddress = PubKeyToAddress(CWalletDB().GetKeyFromKeyPool()); } // Add to list and select it |