Work on hotwallets and payouts. Almost there...

This commit is contained in:
Rick Falkvinge
2015-10-12 01:28:01 +02:00
parent 204a41ac69
commit 6277403451
6 changed files with 151 additions and 7 deletions
+35
View File
@@ -170,6 +170,24 @@ namespace Swarmops.Database
}
}
public int SetHotBitcoinAddressBalance (int hotBitcoinAddressId, Int64 balanceSatoshis)
{
using (DbConnection connection = GetMySqlDbConnection())
{
connection.Open();
using (DbCommand command = GetDbCommand("SetHotBitcoinAddressBalance", connection))
{
command.CommandType = CommandType.StoredProcedure;
AddParameterWithName(command, "hotBitcoinAddressId", hotBitcoinAddressId);
AddParameterWithName(command, "balanceSatoshis", balanceSatoshis);
return Convert.ToInt32(command.ExecuteScalar());
}
}
}
public int CreateHotBitcoinAddressUnspentConditional(int hotBitcoinAddressId, string transactionHash, int transactionOutputIndex, Int64 amountSatoshis, int confirmationCount)
{
using (DbConnection connection = GetMySqlDbConnection())
@@ -191,6 +209,23 @@ namespace Swarmops.Database
}
}
public int DeleteHotBitcoinAddressUnspent(int hotBitcoinAddressUnspentId)
{
using (DbConnection connection = GetMySqlDbConnection())
{
connection.Open();
using (DbCommand command = GetDbCommand("DeleteHotBitcoinAddressUnspent", connection))
{
command.CommandType = CommandType.StoredProcedure;
AddParameterWithName(command, "hotBitcoinAddressUnspentId", hotBitcoinAddressUnspentId);
return Convert.ToInt32(command.ExecuteScalar());
}
}
}
#endregion
}
}