fix fee / feeSat opts
This commit is contained in:
parent
765d3dd658
commit
740be93836
2 changed files with 42 additions and 32 deletions
|
|
@ -125,12 +125,22 @@ TxProposal._trim = function(o) {
|
|||
TxProposal.fromObj = function(o, forceOpts) {
|
||||
preconditions.checkArgument(o.builderObj);
|
||||
delete o['builder'];
|
||||
forceOpts = forceOpts || {};
|
||||
|
||||
|
||||
// force opts is requested.
|
||||
for (var k in forceOpts) {
|
||||
o.builderObj.opts[k] = forceOpts[k];
|
||||
}
|
||||
// Handle undef options
|
||||
if (_.isUndefined(forceOpts.fee) && _.isUndefined(forceOpts.feeSat)) {
|
||||
if (o.builderObj.opts) {
|
||||
o.builderObj.opts.fee = undefined;
|
||||
o.builderObj.opts.feeSat = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
// force opts is requested.
|
||||
for (var k in forceOpts) {
|
||||
o.builderObj.opts[k] = forceOpts[k];
|
||||
}
|
||||
o.builder = TransactionBuilder.fromObj(o.builderObj);
|
||||
} catch (e) {
|
||||
throw new Error("Invalid or Incompatible Backup Detected.");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue