Skip to content

Commit a89b064

Browse files
committed
fix
1 parent 56854e1 commit a89b064

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

packages/neuron-wallet/src/services/transaction-sender.ts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,27 @@ export default class TransactionSender {
200200
// A 65-byte empty signature used as placeholder
201201
witnessesArgs[0].witnessArgs.setEmptyLock()
202202

203-
const privateKey = findPrivateKey(witnessesArgs[0].lockArgs)
203+
let privateKey = ''
204+
try {
205+
privateKey = findPrivateKey(witnessesArgs[0].lockArgs)
206+
} catch (error) {
207+
const BLOCK_UNRECOGNIZED = 0
208+
const IGNORE_UNRECOGNIZED_AND_CONTINUE = 1
209+
const res = await dialog.showMessageBox({
210+
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+
],
216+
defaultId: BLOCK_UNRECOGNIZED,
217+
cancelId: IGNORE_UNRECOGNIZED_AND_CONTINUE,
218+
})
219+
if (res.response === IGNORE_UNRECOGNIZED_AND_CONTINUE) {
220+
continue
221+
}
222+
throw error
223+
}
204224

205225
const serializedWitnesses: (WitnessArgs | string)[] = witnessesArgs.map((value: SignInfo, index: number) => {
206226
const args = value.witnessArgs

0 commit comments

Comments
 (0)