@@ -3036,12 +3036,17 @@ class Wallet extends EventEmitter {
30363036 * @returns {MTX }
30373037 */
30383038
3039- async makeRevoke ( name ) {
3039+ async makeRevoke ( name , acct ) {
30403040 assert ( typeof name === 'string' ) ;
30413041
30423042 if ( ! rules . verifyName ( name ) )
30433043 throw new Error ( 'Invalid name.' ) ;
30443044
3045+ if ( acct != null ) {
3046+ assert ( ( acct >>> 0 ) === acct || typeof acct === 'string' ) ;
3047+ acct = await this . getAccountIndex ( acct ) ;
3048+ }
3049+
30453050 const rawName = Buffer . from ( name , 'ascii' ) ;
30463051 const nameHash = rules . hashName ( rawName ) ;
30473052 const ns = await this . getNameState ( nameHash ) ;
@@ -3057,6 +3062,9 @@ class Wallet extends EventEmitter {
30573062 if ( ! coin )
30583063 throw new Error ( `Wallet does not own: "${ name } ".` ) ;
30593064
3065+ if ( acct != null && ! await this . txdb . hasCoinByAccount ( acct , hash , index ) )
3066+ throw new Error ( `Account does not own: "${ name } ".` ) ;
3067+
30603068 // Is local?
30613069 if ( coin . height < ns . height )
30623070 throw new Error ( `Wallet does not own: "${ name } ".` ) ;
@@ -3100,7 +3108,8 @@ class Wallet extends EventEmitter {
31003108 */
31013109
31023110 async _createRevoke ( name , options ) {
3103- const mtx = await this . makeRevoke ( name ) ;
3111+ const acct = options ? options . account : null ;
3112+ const mtx = await this . makeRevoke ( name , acct ) ;
31043113 await this . fill ( mtx , options ) ;
31053114 return this . finalize ( mtx , options ) ;
31063115 }
@@ -3131,7 +3140,7 @@ class Wallet extends EventEmitter {
31313140
31323141 async _sendRevoke ( name , options ) {
31333142 const passphrase = options ? options . passphrase : null ;
3134- const mtx = await this . _createRevoke ( name ) ;
3143+ const mtx = await this . _createRevoke ( name , options ) ;
31353144 return this . sendMTX ( mtx , passphrase ) ;
31363145 }
31373146
0 commit comments