aboutsummaryrefslogtreecommitdiff
path: root/ui.cpp
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2011-04-05 19:34:06 -0400
committerGavin Andresen <gavinandresen@gmail.com>2011-04-05 19:34:06 -0400
commit57b7fe4e6f4f49de0d11d107c24430cd71007c6b (patch)
tree8d0b8bee4251acda657dea89eb45caf44f58f888 /ui.cpp
parenta2b6c1930dee40b33c3395a60f73e7c4277775cc (diff)
parent6f074b71bb4c21e0a3ce059a64be1e9383538413 (diff)
Merge branch 'deadlock-fixes' of https://github.com/jgarzik/bitcoin
Diffstat (limited to 'ui.cpp')
-rw-r--r--ui.cpp31
1 files changed, 17 insertions, 14 deletions
diff --git a/ui.cpp b/ui.cpp
index fafd3893c8..f4c0c4d749 100644
--- a/ui.cpp
+++ b/ui.cpp
@@ -1934,20 +1934,23 @@ void CSendDialog::OnButtonSend(wxCommandEvent& event)
if (fBitcoinAddress)
{
- // Send to bitcoin address
- CScript scriptPubKey;
- scriptPubKey << OP_DUP << OP_HASH160 << hash160 << OP_EQUALVERIFY << OP_CHECKSIG;
-
- string strError = SendMoney(scriptPubKey, nValue, wtx, true);
- if (strError == "")
- wxMessageBox(_("Payment sent "), _("Sending..."));
- else if (strError == "ABORTED")
- return; // leave send dialog open
- else
- {
- wxMessageBox(strError + " ", _("Sending..."));
- EndModal(false);
- }
+ CRITICAL_BLOCK(cs_main)
+ {
+ // Send to bitcoin address
+ CScript scriptPubKey;
+ scriptPubKey << OP_DUP << OP_HASH160 << hash160 << OP_EQUALVERIFY << OP_CHECKSIG;
+
+ string strError = SendMoney(scriptPubKey, nValue, wtx, true);
+ if (strError == "")
+ wxMessageBox(_("Payment sent "), _("Sending..."));
+ else if (strError == "ABORTED")
+ return; // leave send dialog open
+ else
+ {
+ wxMessageBox(strError + " ", _("Sending..."));
+ EndModal(false);
+ }
+ }
}
else
{