Skip to content

Commit

Permalink
wallet: create revoke lock
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Tyneway committed May 17, 2019
1 parent 4d505be commit cd13198
Showing 1 changed file with 25 additions and 5 deletions.
30 changes: 25 additions & 5 deletions lib/wallet/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -3018,32 +3018,52 @@ class Wallet extends EventEmitter {
}

/**
* Create and finalize an update MTX.
* Create and finalize a revoke
* MTX without a lock.
* @param {String} name
* @param {Object} options
* @returns {MTX}
*/

async createRevoke(name, options) {
async _createRevoke(name, options) {
const mtx = await this.makeRevoke(name);
await this.fill(mtx, options);
return this.finalize(mtx, options);
}

/**
* Create and send an update MTX.
* Create and finalize a revoke
* MTX with a lock.
* @param {String} name
* @param {Object} options
* @returns {MTX}
*/

async createRevoke(name, options) {
const unlock = await this.fundLock.lock();
try {
return await this._createRevoke(name, options);
} finally {
unlock();
}
}

/**
* Create and send a revoke
* MTX without a lock.
* @param {String} name
* @param {Object} options
*/

async _sendRevoke(name, options) {
const passphrase = options ? options.passphrase : null;
const mtx = await this.createRevoke(name);
const mtx = await this._createRevoke(name);
return this.sendMTX(mtx, passphrase);
}

/**
* Create and send an update MTX.
* Create and send a revoke
* MTX with a lock.
* @param {String} name
* @param {Object} options
*/
Expand Down

0 comments on commit cd13198

Please sign in to comment.