diff --git a/lib/TransactionDb.js b/lib/TransactionDb.js index 4f1dbe4..06a558b 100644 --- a/lib/TransactionDb.js +++ b/lib/TransactionDb.js @@ -103,8 +103,15 @@ function spec(b) { assert(typeof j !== 'undefined','Spent could not be stored: tx ' + txid + 'spend in TX:' + k[2] + ',' + k[3]+ ' j:' + j); - ret[j].spendTxId = v[0]; - ret[j].spendIndex = parseInt(v[1]); +/// TODO Handle multiple addresses here! + if (ret[j].spendTxId) { + // double spend! + assert(0); + } + else { + ret[j].spendTxId = v[0]; + ret[j].spendIndex = parseInt(v[1]); + } }) .on('error', function (err) { return cb(err);