add check to core, not only UI
This commit is contained in:
parent
1714e8dffa
commit
90ebd8deb5
1 changed files with 2 additions and 0 deletions
|
|
@ -13,6 +13,7 @@ var buffertools = bitcore.buffertools;
|
|||
var Builder = bitcore.TransactionBuilder;
|
||||
var SecureRandom = bitcore.SecureRandom;
|
||||
var Base58Check = bitcore.Base58.base58Check;
|
||||
var Address = bitcore.Address;
|
||||
|
||||
var AddressIndex = require('./AddressIndex');
|
||||
var PublicKeyRing = require('./PublicKeyRing');
|
||||
|
|
@ -696,6 +697,7 @@ Wallet.prototype.createTxSync = function(toAddress, amountSatStr, comment, utxos
|
|||
opts = opts || {};
|
||||
|
||||
var amountSat = bignum(amountSatStr);
|
||||
preconditions.checkArgument(new Address(toAddress).network().name === this.networkName);
|
||||
|
||||
if (!pkr.isComplete()) {
|
||||
throw new Error('publicKeyRing is not complete');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue