Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
exports.createMoneypots = function(userId, pots, callback) {
//TODO: Implement Eric's Daemon :p
var tasks = {
return function(callback) {
var key = bitcoin.ECKey.makeRandom();
var privKey = key.toWIF();
var pubKey =;
var active = true;
var fundedUsd = pot.amount;
var btSubscriptionId = pot.subscriptionId;
var tag =;
db.addMoneyPot(userId, privKey, pubKey, tag, active, fundedUsd, btSubscriptionId, function(err) {
if(err) {
//if (err instanceof Error)
return callback(new Error('Error adding a moneypots to the database for user -> ' + userId + ' \n' + err));
async.parallel(tasks, callback);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.