@@ -3018,32 +3018,52 @@ class Wallet extends EventEmitter {
3018
3018
}
3019
3019
3020
3020
/**
3021
- * Create and finalize an update MTX.
3021
+ * Create and finalize a revoke
3022
+ * MTX without a lock.
3022
3023
* @param {String } name
3023
3024
* @param {Object } options
3024
3025
* @returns {MTX }
3025
3026
*/
3026
3027
3027
- async createRevoke ( name , options ) {
3028
+ async _createRevoke ( name , options ) {
3028
3029
const mtx = await this . makeRevoke ( name ) ;
3029
3030
await this . fill ( mtx , options ) ;
3030
3031
return this . finalize ( mtx , options ) ;
3031
3032
}
3032
3033
3033
3034
/**
3034
- * Create and send an update MTX.
3035
+ * Create and finalize a revoke
3036
+ * MTX with a lock.
3037
+ * @param {String } name
3038
+ * @param {Object } options
3039
+ * @returns {MTX }
3040
+ */
3041
+
3042
+ async createRevoke ( name , options ) {
3043
+ const unlock = await this . fundLock . lock ( ) ;
3044
+ try {
3045
+ return await this . _createRevoke ( name , options ) ;
3046
+ } finally {
3047
+ unlock ( ) ;
3048
+ }
3049
+ }
3050
+
3051
+ /**
3052
+ * Create and send a revoke
3053
+ * MTX without a lock.
3035
3054
* @param {String } name
3036
3055
* @param {Object } options
3037
3056
*/
3038
3057
3039
3058
async _sendRevoke ( name , options ) {
3040
3059
const passphrase = options ? options . passphrase : null ;
3041
- const mtx = await this . createRevoke ( name ) ;
3060
+ const mtx = await this . _createRevoke ( name ) ;
3042
3061
return this . sendMTX ( mtx , passphrase ) ;
3043
3062
}
3044
3063
3045
3064
/**
3046
- * Create and send an update MTX.
3065
+ * Create and send a revoke
3066
+ * MTX with a lock.
3047
3067
* @param {String } name
3048
3068
* @param {Object } options
3049
3069
*/
0 commit comments