chain: expose coins methods.

This commit is contained in:
Christopher Jeffrey 2016-12-17 14:40:03 -08:00
parent 514e735a96
commit 5fb16543f1
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -1739,6 +1739,21 @@ Chain.prototype.getOrphan = function getOrphan(hash) {
return this.orphan.bmap[hash] || null;
};
/**
* Get coin viewpoint.
* @param {TX} tx
* @returns {Promise} - Returns {@link CoinView}.
*/
Chain.prototype.getCoinView = co(function* getCoinView(tx) {
var unlock = yield this.locker.lock();
try {
return yield this.db.getCoinView(tx);
} finally {
unlock();
}
});
/**
* Test the chain to see if it is synced.
* @returns {Boolean}