diff options
| author | Adam Soltys <[email protected]> | 2020-04-05 09:50:00 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2020-04-05 09:52:32 -0700 |
| commit | e8b5f4046b54b5fa262a0a999a687a3edfca184a (patch) | |
| tree | edd880cc6f642ed5aa7ae9fe6db9d41d03fa4af0 | |
| parent | 3c83b64ca231170ff379541842dba11371a777d7 (diff) | |
| download | coinos-server-e8b5f4046b54b5fa262a0a999a687a3edfca184a.tar.gz coinos-server-e8b5f4046b54b5fa262a0a999a687a3edfca184a.zip | |
fix change detection logic
| -rw-r--r-- | routes/bitcoin/send.js | 4 | ||||
| -rw-r--r-- | routes/liquid/send.js | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/routes/bitcoin/send.js b/routes/bitcoin/send.js index 6ad518c7..948e5386 100644 --- a/routes/bitcoin/send.js +++ b/routes/bitcoin/send.js @@ -9,9 +9,9 @@ module.exports = async (req, res) => { let fee = toSats(tx.fee); const isChange = async address => - !((await bc.getAddressInfo(address)).ismine) || + (await bc.getAddressInfo(address)).ismine && ( !Object.keys(addresses).includes(address) || - address === user.address; + address === user.address); tx = await bc.decodeRawTransaction(hex); diff --git a/routes/liquid/send.js b/routes/liquid/send.js index c657ae30..2ae783c4 100644 --- a/routes/liquid/send.js +++ b/routes/liquid/send.js @@ -8,9 +8,9 @@ module.exports = async (req, res) => { } = req.body; const isChange = async address => - !((await lq.getAddressInfo(address)).ismine) || - !Object.keys(addresses).includes(address) || - address === user.liquid; + ((await lq.getAddressInfo(address)).ismine) && + (!Object.keys(addresses).includes(address) || + address === user.liquid); const unblinded = await lq.unblindRawTransaction(hex); tx = await lq.decodeRawTransaction(unblinded.hex); |
