Fix: transaction broadcasting hangs
MODIFY
HiddenWallet.FullSpvWallet/WalletJob.cs
HiddenWallet.FullSpvWallet/WalletJob.cs
@@ -38,6 +38,7 @@ namespace HiddenWallet.FullSpv
public SmartBitClient TorSmartBitClient { get; private set; }
public DotNetTor.ControlPort.Client ControlPortClient { get; private set; }
+ private SocksPortHandler SocksPortHandler { get; set; }
public BlockDownloader BlockDownloader;
@@ -243,6 +244,7 @@ namespace HiddenWallet.FullSpv
};
ControlPortClient = controlPortClient;
+ SocksPortHandler = handler;
TorSmartBitClient = new SmartBitClient(safeToTrack.Network, handler, false);
FeeService = new FeeService(safeToTrack.Network, ControlPortClient, disposeTorControl: false, handler: handler, disposeHandler: false);
@@ -373,6 +375,14 @@ namespace HiddenWallet.FullSpv
FeeService?.Dispose();
TorSmartBitClient?.Dispose();
try
+ {
+ SocksPortHandler.Dispose();
+ }
+ catch
+ {
+ // cannot happen
+ }
+ try
{
ControlPortClient?.DisconnectDisposeSocket();
}

MODIFY
HiddenWallet.Gui/app/js/broadcast-window.ts
HiddenWallet.Gui/app/js/broadcast-window.ts
@@ -342,14 +342,19 @@ function rebuildTransaction() {
httpPostWalletAsync(`${buildFund}-transaction/${previousBobOrAlice}`, request, function (json) {
if (json.Success === false) {
- let alertMessage: string = `Couldn't rebuild the transaciton: ${json.Message}`;
+ let alertMessage: string = "Couldn't rebuild the transaciton";
+ try {
+ alertMessage += ": " + json.Message;
if (!isBlank(json.Details)) {
alertMessage = `${alertMessage}
Details:
${json.Details}`;
}
+ } catch {
+
+ }
alert(alertMessage);
}
@@ -379,19 +384,22 @@ function broadcastTransaction() {
window.close();
}
else {
- let failText = "FAIL! " + json.Message;
+ let alertMessage = "FAIL! ";
+ try {
+ alertMessage = alertMessage + json.Message;
if (json.Details) {
- failText =
- `${failText}
+ alertMessage =
+ `${alertMessage}
Details: ${json.Details}`;
+ }
+ } catch{ }
- alert(failText);
+ alert(alertMessage);
broadcastButton.innerHTML = '<span class="mdi mdi-tor"></span> Try Broadcast Again';
containerElement.setAttribute("style", "pointer-events:all;");
}
- }
});
}
\ No newline at end of file

MODIFY
HiddenWallet.Gui/app/js/decryption-phase.ts
HiddenWallet.Gui/app/js/decryption-phase.ts
@@ -128,7 +128,14 @@ function generateWallet() {
httpPostWalletAsync("create", obj, function (json) {
if (json.Success == false) {
- alert("Could not generate wallet, details:\n\n" + json.Message);
+ let alertMessage = "Could not generate wallet";
+ try {
+ alertMessage += ", details:\n\n" + json.Message;
+ } catch {
+
+ }
+ alert(alertMessage);
+
genWalletButton.innerHTML = "Generate";
}
else {
@@ -177,7 +184,14 @@ function recoverWallet() {
httpPostWalletAsync("recover", obj, function (json) {
if (json.Success == false) {
- alert("Could not recover wallet, details:\n\n" + json.Message);
+ let alertMessage = "Could not recover wallet";
+ try {
+ alertMessage += ", details:\n\n" + json.Message;
+ } catch {
+
+ }
+ alert(alertMessage);
+
recWalletButton.innerHTML = "Recover";
}
else {
@@ -219,7 +233,13 @@ function decryptWallet() {
httpPostWalletAsync("load", obj, function (json) {
if (json.Success == false) {
- alert("Could not decrypt wallet, details:\n\n" + json.Message);
+ let alertMessage = "Could not decrypt wallet";
+ try {
+ alertMessage += ", details:\n\n" + json.Message;
+ } catch {
+
+ }
+ alert(alertMessage);
decWalletButton.innerHTML = "Decrypt";
}
else {

MODIFY
HiddenWallet.Gui/app/js/wallet-phase.ts
HiddenWallet.Gui/app/js/wallet-phase.ts
@@ -279,13 +279,19 @@ function mix() {
httpPostTumblerAsync("tumble", obj, function (json) {
try {
if (json.Success === false) {
- let alertMessage: string = "Couldn't finish all requested mixing rounds: " + json.Message;
+ let alertMessage: string = "Couldn't finish all requested mixing rounds";
+
+ try {
+ alertMessage += ": " + json.Message;
if (!isBlank(json.Details)) {
alertMessage = alertMessage
+ "\n"
+ "\n" + json.Details;
}
+ } catch {
+
+ }
alert(alertMessage);
}
@@ -315,13 +321,18 @@ function cancelMix()
httpGetTumblerAsync("cancel-mix", function (json) {
try {
if (json.Success === false) {
- let alertMessage: string = "Couldn't cancel the mix: " + json.Message;
+ let alertMessage: string = "Couldn't cancel the mix";
+ try {
+ alertMessage += ": " + json.Message;
if (!isBlank(json.Details)) {
alertMessage = alertMessage
+ "\n"
+ "\n" + json.Details;
}
+ } catch {
+
+ }
alert(alertMessage);
}
@@ -562,13 +573,19 @@ function buildTransaction() {
httpPostWalletAsync(`build-transaction/${bobOrAlice}`, buildTransactionRequest, function (json) {
if (json.Success === false) {
- let alertMessage: string = "Couldn't build the tansaction: " + json.Message;
+ let alertMessage: string = "Couldn't build the tansaction"
+
+ try {
+ alertMessage += ": " + json.Message;
if (!isBlank(json.Details)) {
alertMessage = alertMessage
+ "\n"
+ "\n" + json.Details;
}
+ } catch {
+
+ }
alert(alertMessage);
}

Fix: transaction broadcasting hangs