assert inputs & outputs are consistent
This commit is contained in:
parent
2e1cc88c56
commit
4d25161098
|
@ -185,6 +185,7 @@ TxProposal.prototype._buildTx = function() {
|
|||
var totalInputs = _.sum(t.inputs, 'output.satoshis');
|
||||
var totalOutputs = _.sum(t.outputs, 'satoshis');
|
||||
|
||||
$.checkState(totalInputs > 0 && totalOutputs > 0 && totalInputs >= totalOutputs);
|
||||
$.checkState(totalInputs - totalOutputs <= Defaults.MAX_TX_FEE);
|
||||
|
||||
return t;
|
||||
|
|
Loading…
Reference in New Issue