Preserve socket.io BlockTimestamp backward compatibility

utxostat
Martin Boehm 2019-04-05 17:13:56 +02:00
parent b227a8e777
commit 4b0addbe98
1 changed files with 3 additions and 1 deletions

View File

@ -328,13 +328,15 @@ func txToResTx(tx *api.Tx) resTx {
outputs[i] = output
}
var h int
var blocktime int64
if tx.Confirmations == 0 {
h = -1
} else {
h = int(tx.Blockheight)
blocktime = tx.Blocktime
}
return resTx{
BlockTimestamp: tx.Blocktime,
BlockTimestamp: blocktime,
FeeSatoshis: tx.FeesSat.AsInt64(),
Hash: tx.Txid,
Height: h,