chain: expose coins methods.
This commit is contained in:
parent
514e735a96
commit
5fb16543f1
@ -1739,6 +1739,21 @@ Chain.prototype.getOrphan = function getOrphan(hash) {
|
|||||||
return this.orphan.bmap[hash] || null;
|
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.
|
* Test the chain to see if it is synced.
|
||||||
* @returns {Boolean}
|
* @returns {Boolean}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user