@@ -2897,32 +2897,52 @@ class Wallet extends EventEmitter {
2897
2897
}
2898
2898
2899
2899
/**
2900
- * Create and finalize a finalize MTX.
2900
+ * Create and finalize a finalize
2901
+ * MTX without a lock.
2901
2902
* @param {String } name
2902
2903
* @param {Object } options
2903
2904
* @returns {MTX }
2904
2905
*/
2905
2906
2906
- async createFinalize ( name , options ) {
2907
+ async _createFinalize ( name , options ) {
2907
2908
const mtx = await this . makeFinalize ( name ) ;
2908
2909
await this . fill ( mtx , options ) ;
2909
2910
return this . finalize ( mtx , options ) ;
2910
2911
}
2911
2912
2912
2913
/**
2913
- * Create and send a finalize MTX.
2914
+ * Create and finalize a finalize
2915
+ * MTX with a lock.
2916
+ * @param {String } name
2917
+ * @param {Object } options
2918
+ * @returns {MTX }
2919
+ */
2920
+
2921
+ async createFinalize ( name , options ) {
2922
+ const unlock = await this . fundLock . lock ( ) ;
2923
+ try {
2924
+ return await this . _createFinalize ( name , options ) ;
2925
+ } finally {
2926
+ unlock ( ) ;
2927
+ }
2928
+ }
2929
+
2930
+ /**
2931
+ * Create and send a finalize
2932
+ * MTX without a lock.
2914
2933
* @param {String } name
2915
2934
* @param {Object } options
2916
2935
*/
2917
2936
2918
2937
async _sendFinalize ( name , options ) {
2919
2938
const passphrase = options ? options . passphrase : null ;
2920
- const mtx = await this . createFinalize ( name , options ) ;
2939
+ const mtx = await this . _createFinalize ( name , options ) ;
2921
2940
return this . sendMTX ( mtx , passphrase ) ;
2922
2941
}
2923
2942
2924
2943
/**
2925
- * Create and send a finalize MTX.
2944
+ * Create and send a finalize
2945
+ * MTX with a lock.
2926
2946
* @param {String } name
2927
2947
* @param {Object } options
2928
2948
*/
0 commit comments