Merge PR #818 from 'nodech/fix-wallet-http-revealall'

This commit is contained in:
Nodari Chkuaselidze 2023-05-31 14:56:56 +04:00
commit 5bed384b37
No known key found for this signature in database
GPG key ID: B018A7BB437D1F05

View file

@ -1152,12 +1152,13 @@ class HTTP extends Server {
options
);
if (broadcastBid)
auctionTxs.bid = await req.wallet.sendMTX(auctionTxs.bid, passphrase);
if (sign) {
if (broadcastBid) {
auctionTxs.bid = await req.wallet.sendMTX(auctionTxs.bid, passphrase);
} else {
if (!broadcastBid)
await req.wallet.sign(auctionTxs.bid, passphrase);
}
await req.wallet.sign(auctionTxs.reveal, passphrase);
}
@ -1185,13 +1186,15 @@ class HTTP extends Server {
enforce(broadcast ? sign : true, 'Must sign when broadcasting.');
if (!name) {
const tx = await req.wallet.sendRevealAll();
return res.json(200, tx.getJSON(this.network));
}
const options = TransactionOptions.fromValidator(valid);
const mtx = await req.wallet.createReveal(name, options);
let mtx;
if (!name) {
mtx = await req.wallet.createRevealAll(options);
} else {
mtx = await req.wallet.createReveal(name, options);
}
if (broadcast) {
const tx = await req.wallet.sendMTX(mtx, passphrase);