mirror of https://github.com/BTCPrivate/copay.git
fix trezor
This commit is contained in:
parent
3b6d656c50
commit
7ea75cd964
|
@ -75,8 +75,28 @@ angular.module('copayApp.services')
|
|||
outputs = [];
|
||||
var tmpOutputs = [];
|
||||
|
||||
if (txp.type != 'simple')
|
||||
|
||||
if (txp.type && txp.type != 'simple') {
|
||||
return callback('Only TXPs type SIMPLE are supported in TREZOR');
|
||||
} else if (txp.outputs) {
|
||||
if (txp.outputs.length > 1)
|
||||
return callback('Only single output TXPs are supported in TREZOR');
|
||||
} else {
|
||||
return callback('Unknown TXP at TREZOR');
|
||||
}
|
||||
|
||||
if (txp.outputs) {
|
||||
|
||||
if (!txp.toAddress)
|
||||
txp.toAddress = txp.outputs[0].toAddress;
|
||||
|
||||
if (!txp.amount)
|
||||
txp.amount = txp.outputs[0].amount;
|
||||
}
|
||||
|
||||
if (!txp.toAddress || !txp.amount)
|
||||
return callback('No address or amount at TREZOR signing');
|
||||
|
||||
|
||||
var toScriptType = 'PAYTOADDRESS';
|
||||
if (txp.toAddress.charAt(0) == '2' || txp.toAddress.charAt(0) == '3')
|
||||
|
|
Loading…
Reference in New Issue