Forgot to sub the donation address

This commit is contained in:
Rick Falkvinge
2017-02-19 21:42:24 +01:00
parent 98969a57c0
commit 61cb1b9de8
7 changed files with 42 additions and 22 deletions
+15 -4
View File
@@ -989,16 +989,27 @@ namespace Swarmops.Backend
public static void AddBitcoinAddress(string address)
{
JObject json = new JObject();
json["op"] = "addr_sub";
json["addr"] = address;
if (_addressLookup == null)
{
_addressLookup = new SerializableDictionary<string, bool>();
}
if (!_addressLookup.ContainsKey(address))
{
JObject json = new JObject();
json["op"] = "addr_sub";
json["addr"] = address;
_blockChainInfoSocket.Send(json.ToString());
_addressLookup[address] = true; // dupe prevention
}
_blockChainInfoSocket.Send(json.ToString());
}
private static WebSocket _blockChainInfoSocket;
private static WebSocketServer _socketServer;
private static SerializableDictionary<string, JObject> _transactionCache; // Need mechanism to clear this over time
private static SerializableDictionary<string, bool> _addressLookup;
}
}