|
|
@ -203,6 +203,8 @@ var Wallet = function (seed, options) { |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
checkInsufficientFund(totalInValue, value, fee) |
|
|
|
|
|
|
|
this.sign(tx) |
|
|
|
|
|
|
|
return tx |
|
|
@ -214,6 +216,13 @@ var Wallet = function (seed, options) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function checkInsufficientFund(totalInValue, value, fee) { |
|
|
|
if(totalInValue < value + fee) { |
|
|
|
throw new Error('Not enough money to send funds including transaction fee. Have: ' + |
|
|
|
totalInValue + ', needed: ' + (value + fee)) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function estimateFeePadChangeOutput(tx){ |
|
|
|
var tmpTx = tx.clone() |
|
|
|
tmpTx.addOutput(getChangeAddress(), 0) |
|
|
|