indutny/bcoin — pull request #13 by chjj (2014-05-18 18:21:51+00:00)
Title: tx-pool: allow tx-pool to function without a wallet.

I've been messing around with tx-pool to allow it to be instantiated without being associated with a wallet. If no wallet is passed in, it can be associated with every transaction equally.

As you guessed, this would allow easy global saving of *every* transaction, not just those associated with a wallet:

``` js
...

// tx-pool now takes an options object (or a wallet)
var txPool = bcoin.txPool({
storage: pool.storage
});

pool.on('tx', function(tx) {
txPool.add(tx);
});
```

Later:

``` js
// Checks in memory storage (default limit of 1000 tx) and db storage:
txPool.get(arbitraryTx, function(err, tx) {
if (err)
throw err;
console.log(tx);
});
```

Just want to know what you think, @indutny. This isn't essential by any means. Of course, someone could simply save all transactions by hand, but having an object for it might be nicer.