http api output lock/finalize order (#2034)

This commit is contained in:
Yeastplume 2018-11-28 11:02:29 +00:00 committed by GitHub
parent b95caecc27
commit 2a77207713
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -339,15 +339,16 @@ where
if args.method == "http" {
let adapter = HTTPWalletCommAdapter::new();
slate = adapter.send_tx_sync(&args.dest, &slate)?;
api.tx_lock_outputs(&slate, lock_fn)?;
api.finalize_tx(&mut slate)?;
} else if args.method == "file" {
let adapter = FileWalletCommAdapter::new();
adapter.send_tx_async(&args.dest, &slate)?;
api.tx_lock_outputs(&slate, lock_fn)?;
} else {
error!("unsupported payment method: {}", args.method);
return Err(ErrorKind::ClientCallback("unsupported payment method"))?;
}
api.tx_lock_outputs(&slate, lock_fn)?;
Ok(slate)
}))
}