@@ -2763,32 +2763,52 @@ class Wallet extends EventEmitter {
2763
2763
}
2764
2764
2765
2765
/**
2766
- * Create and finalize a cancel MTX.
2766
+ * Create and finalize a cancel
2767
+ * MTX without a lock.
2767
2768
* @param {String } name
2768
2769
* @param {Object } options
2769
2770
* @returns {MTX }
2770
2771
*/
2771
2772
2772
- async createCancel ( name , options ) {
2773
+ async _createCancel ( name , options ) {
2773
2774
const mtx = await this . makeCancel ( name ) ;
2774
2775
await this . fill ( mtx , options ) ;
2775
2776
return this . finalize ( mtx , options ) ;
2776
2777
}
2777
2778
2778
2779
/**
2779
- * Create and send a cancel MTX.
2780
+ * Create and finalize a cancel
2781
+ * MTX with a lock.
2782
+ * @param {String } name
2783
+ * @param {Object } options
2784
+ * @returns {MTX }
2785
+ */
2786
+
2787
+ async createCancel ( name , options ) {
2788
+ const unlock = await this . fundLock . lock ( ) ;
2789
+ try {
2790
+ return await this . _createCancel ( name , options ) ;
2791
+ } finally {
2792
+ unlock ( ) ;
2793
+ }
2794
+ }
2795
+
2796
+ /**
2797
+ * Create and send a cancel
2798
+ * MTX without a lock.
2780
2799
* @param {String } name
2781
2800
* @param {Object } options
2782
2801
*/
2783
2802
2784
2803
async _sendCancel ( name , options ) {
2785
2804
const passphrase = options ? options . passphrase : null ;
2786
- const mtx = await this . createCancel ( name , options ) ;
2805
+ const mtx = await this . _createCancel ( name , options ) ;
2787
2806
return this . sendMTX ( mtx , passphrase ) ;
2788
2807
}
2789
2808
2790
2809
/**
2791
- * Create and send a cancel MTX.
2810
+ * Create and send a cancel
2811
+ * MTX with a lock.
2792
2812
* @param {String } name
2793
2813
* @param {Object } options
2794
2814
*/
0 commit comments