cash out works for btc
This commit is contained in:
parent
e2d619c56d
commit
e227716ad9
3 changed files with 5 additions and 4 deletions
|
|
@ -329,7 +329,7 @@ function addPendingTx (client, session, incoming, currencyCode, cryptoCode, toAd
|
||||||
'currency_code', 'crypto_code', 'to_address', 'satoshis']
|
'currency_code', 'crypto_code', 'to_address', 'satoshis']
|
||||||
var sql = getInsertQuery('pending_transactions', fields, false)
|
var sql = getInsertQuery('pending_transactions', fields, false)
|
||||||
var values = [session.fingerprint, session.id, incoming, currencyCode,
|
var values = [session.fingerprint, session.id, incoming, currencyCode,
|
||||||
cryptoCode, toAddress, satoshis]
|
cryptoCode, toAddress, satoshis.toString()]
|
||||||
query(client, sql, values, function (err) {
|
query(client, sql, values, function (err) {
|
||||||
cb(err)
|
cb(err)
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -132,6 +132,10 @@ function send (req, res) {
|
||||||
|
|
||||||
function cashOut (req, res) {
|
function cashOut (req, res) {
|
||||||
logger.info({tx: req.body, cmd: 'cashOut'})
|
logger.info({tx: req.body, cmd: 'cashOut'})
|
||||||
|
var tx = req.body
|
||||||
|
tx.cryptoAtoms = new BigNumber(tx.cryptoAtoms)
|
||||||
|
tx.satoshis = tx.cryptoAtoms
|
||||||
|
|
||||||
plugins.cashOut(session(req), req.body, function (err, bitcoinAddress) {
|
plugins.cashOut(session(req), req.body, function (err, bitcoinAddress) {
|
||||||
if (err) logger.error(err)
|
if (err) logger.error(err)
|
||||||
|
|
||||||
|
|
|
||||||
3
todo.txt
3
todo.txt
|
|
@ -30,7 +30,4 @@ alter table pending_transactions alter satoshis TYPE bigint;
|
||||||
alter table bills add crypto_code text default 'BTC';
|
alter table bills add crypto_code text default 'BTC';
|
||||||
alter table bills alter satoshis TYPE bigint;
|
alter table bills alter satoshis TYPE bigint;
|
||||||
|
|
||||||
- get cryptoCode from pending tx
|
|
||||||
- update cryptoCode for bills insert
|
- update cryptoCode for bills insert
|
||||||
- insert correct satoshis in pending tx -- actually this is supposed to be 0
|
|
||||||
- fix satoshi math in postgres module by moving to bignumber math
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue