Merge pull request #444 from nodar-chkuaselidze/wallet-api/create-tx

Allow optional signing in createTX http endpoint
This commit is contained in:
Javed Khan 2018-10-19 23:22:54 +05:30 committed by GitHub
commit fe340265c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -465,6 +465,7 @@ class HTTP extends Server {
const valid = Validator.fromRequest(req);
const passphrase = valid.str('passphrase');
const outputs = valid.array('outputs', []);
const sign = valid.bool('sign', true);
const options = {
rate: valid.u64('rate'),
@ -499,7 +500,8 @@ class HTTP extends Server {
const tx = await req.wallet.createTX(options);
await req.wallet.sign(tx, passphrase);
if (sign)
await req.wallet.sign(tx, passphrase);
res.json(200, tx.getJSON(this.network));
});