@@ -32,6 +32,7 @@ import {
3232 NoMatchAddressForSign ,
3333 SignTransactionFailed ,
3434 TransactionIsNotCommittedYet ,
35+ UnrecognizedLockScript ,
3536} from '../exceptions'
3637import AssetAccountInfo from '../models/asset-account-info'
3738import MultisigConfigModel from '../models/multisig-config'
@@ -206,19 +207,32 @@ export default class TransactionSender {
206207 } catch ( error ) {
207208 const BLOCK_UNRECOGNIZED = 0
208209 const IGNORE_UNRECOGNIZED_AND_CONTINUE = 1
210+
211+ let message = t ( 'messageBox.unrecognized-lock-script.message' )
212+ let buttons = [
213+ t ( 'messageBox.unrecognized-lock-script.buttons.cancel' ) ,
214+ t ( 'messageBox.unrecognized-lock-script.buttons.ignore' ) ,
215+ ]
216+
217+ const input = tx . inputs . find ( input => input . lockHash === lockHash )
218+ if ( input && input . lock && SystemScriptInfo . isMultiSignCodeHash ( input . lock . codeHash ) ) {
219+ message = t ( 'messageBox.unrecognized-multisig-transaction.message' )
220+ buttons = [ t ( 'messageBox.unrecognized-multisig-transaction.buttons.cancel' ) ]
221+ }
222+
209223 const res = await dialog . showMessageBox ( {
210224 type : 'warning' ,
211- message : t ( 'messageBox.unrecognized-lock-script.message' ) ,
212- buttons : [
213- t ( 'messageBox.unrecognized-lock-script.buttons.cancel' ) ,
214- t ( 'messageBox.unrecognized-lock-script.buttons.ignore' ) ,
215- ] ,
225+ message,
226+ buttons,
216227 defaultId : BLOCK_UNRECOGNIZED ,
217228 cancelId : IGNORE_UNRECOGNIZED_AND_CONTINUE ,
218229 } )
219230 if ( res . response === IGNORE_UNRECOGNIZED_AND_CONTINUE ) {
220231 continue
221232 }
233+ if ( res . response === BLOCK_UNRECOGNIZED ) {
234+ throw new UnrecognizedLockScript ( message )
235+ }
222236 throw error
223237 }
224238
0 commit comments