aboutsummaryrefslogtreecommitdiffstats
path: root/routes/assets.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2021-08-02 02:05:28 -0700
committerAdam Soltys <[email protected]>2021-08-02 02:05:28 -0700
commita7168a10f45c305a45d2e56db6fbfeef210f1b9b (patch)
tree7086c79e947103e1315b8ccc285c5d4ea9ce9112 /routes/assets.js
parente44bd5d724f2408b0b8c249c45c254f4dce68754 (diff)
downloadcoinos-server-a7168a10f45c305a45d2e56db6fbfeef210f1b9b.tar.gz
coinos-server-a7168a10f45c305a45d2e56db6fbfeef210f1b9b.zip
silhouettes
Diffstat (limited to 'routes/assets.js')
-rw-r--r--routes/assets.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/routes/assets.js b/routes/assets.js
index f99301ae..2494ee94 100644
--- a/routes/assets.js
+++ b/routes/assets.js
@@ -111,7 +111,7 @@ app.post(
if (filename) contract.filename = filename;
- l.info("attempting issuance", req.user.username, contract);
+ l.info("attempting issuance", req.user.username, contract, "address", address, "pubkey", pubkey);
sha256.update(JSON.stringify(contract));
const hash = sha256.digest("hex");
@@ -149,7 +149,7 @@ app.post(
const srt = await lq.signRawTransactionWithWallet(brt);
const allowed = (await lq.testMempoolAccept([srt.hex]))[0].allowed;
fs.writeFileSync('tx', srt.hex);
- if (!allowed) throw new Error();
+ if (!allowed) throw new Error("issuance rejected by mempool");
const txid = await lq.sendRawTransaction(srt.hex);
await db.transaction(async transaction => {
@@ -185,6 +185,7 @@ app.post(
await account.reload({ transaction });
emit(user.username, "account", account);
+ if (address) return;
account = await db.Account.create(
{
asset,
@@ -271,7 +272,7 @@ app.post(
res.send(issuances[txid]);
} catch (e) {
- l.error("asset issuance failed", e.message);
+ l.error("asset issuance failed", e.message, e.stack);
res.status(500).send(e.message);
}
})