Skip to content

Commit

Permalink
Merge pull request #144 from tynes/create-tx-sign-flag
Browse files Browse the repository at this point in the history
wallet/http: allow creation of unsigned tx
  • Loading branch information
boymanjor authored May 19, 2019
2 parents 702d1ba + ea92332 commit 956924b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/wallet/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,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'),
Expand Down Expand Up @@ -486,7 +487,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));
});
Expand Down

0 comments on commit 956924b

Please sign in to comment.