Implement small features like allowing spending unconfirmed transactions
MODIFY
HiddenWallet/HiddenWallet.API/Controllers/WalletController.cs
HiddenWallet/HiddenWallet.API/Controllers/WalletController.cs
@@ -225,7 +225,7 @@ namespace HiddenWallet.API.Controllers
{
try
{
- if (request == null || request.Password == null || request.Address == null || request.Amount == null || request.FeeType == null || request.AllowUnconfirmed == null)
+ if (request == null || request.Password == null || request.Address == null || request.Amount == null || request.FeeType == null)
{
return new ObjectResult(new FailureResponse { Message = "Bad request", Details = "" });
}
@@ -277,9 +277,7 @@ namespace HiddenWallet.API.Controllers
return new ObjectResult(new FailureResponse { Message = "Wrong fee type", Details = "" });
}
- var allowUnconfirmed = bool.Parse(request.AllowUnconfirmed);
-
- return new ObjectResult(Global.WalletWrapper.BuildTransaction(request.Password, safeAccount, address, amount, feeType, allowUnconfirmed));
+ return new ObjectResult(Global.WalletWrapper.BuildTransaction(request.Password, safeAccount, address, amount, feeType));
}
catch (Exception ex)
{

MODIFY
HiddenWallet/HiddenWallet.API/Models/BuildTransactionRequest.cs
HiddenWallet/HiddenWallet.API/Models/BuildTransactionRequest.cs
@@ -11,6 +11,5 @@ namespace HiddenWallet.API.Models
public string Address { get; set; }
public string Amount { get; set; }
public string FeeType { get; set; }
- public string AllowUnconfirmed { get; set; }
}
}

MODIFY
HiddenWallet/HiddenWallet.API/Wrappers/WalletWrapper.cs
HiddenWallet/HiddenWallet.API/Wrappers/WalletWrapper.cs
@@ -175,7 +175,7 @@ namespace HiddenWallet.API.Wrappers
_incomingAlice = aa.Unconfirmed;
var ab = _walletJob.GetBalance(out IDictionary<Coin, bool> unspentCoinsBob, BobAccount);
_availableBob = ab.Confirmed;
- _availableBob = ab.Unconfirmed;
+ _incomingBob = ab.Unconfirmed;
// receive
var ua = _walletJob.GetUnusedScriptPubKeys(AliceAccount, HdPathType.Receive).ToArray();
@@ -244,10 +244,10 @@ namespace HiddenWallet.API.Wrappers
else return new StatusResponse { HeaderHeight = 0, TrackingHeight = 0, ConnectedNodeCount = 0, MemPoolTransactionCount = 0, WalletState = WalletState.NotStarted.ToString(), ChangeBump = 0 };
}
- public BaseResponse BuildTransaction(string password, SafeAccount safeAccount, BitcoinAddress address, Money amount, FeeType feeType, bool allowUnconfirmed)
+ public BaseResponse BuildTransaction(string password, SafeAccount safeAccount, BitcoinAddress address, Money amount, FeeType feeType)
{
if (password != _password) throw new InvalidOperationException("Wrong password");
- var result = _walletJob.BuildTransactionAsync(address.ScriptPubKey, amount, feeType, safeAccount, allowUnconfirmed).Result;
+ var result = _walletJob.BuildTransactionAsync(address.ScriptPubKey, amount, feeType, safeAccount, Config.CanSpendUnconfirmed).Result;
if (result.Success)
{

MODIFY
HiddenWallet/HiddenWallet.GUI/app/js/wallet-phase.js
HiddenWallet/HiddenWallet.GUI/app/js/wallet-phase.js
@@ -173,7 +173,6 @@ function buildTransaction() {
obj.address = address;
obj.amount = amount;
obj.feeType = feeType;
- obj.allowUnconfirmed = false;
let json;
let tabs = document.getElementById("tabs");

Implement small features like allowing spending unconfirmed transactions