Files
purple-explorer/models/tx.js
T
joeuhren 66e3ca31e6 Add support for bitcoin P2PK scripts/txes
-Adds a tx_type field to the tx model which is typically null for "normal" transaction types, but can also display 'p2pk' for bitcoin txes which require addtional encoding to reveal the P2PKH address as well as 'zksnarks' for transactions with hidden sender or receiver data
-Additional fixes for how data is displayed when a valid wallet address cannot be found
-Includes some small updates to how zksnarks transactions display hidden sender/receiver data
2021-03-20 01:34:13 -06:00

17 lines
625 B
JavaScript

var mongoose = require('mongoose'),
Schema = mongoose.Schema;
var TxSchema = new Schema({
txid: { type: String, lowercase: true, unique: true, index: true},
vin: { type: Array, default: [] },
vout: { type: Array, default: [] },
total: { type: Number, default: 0, index: true },
timestamp: { type: Number, default: 0, index: true },
blockhash: { type: String, index: true },
blockindex: {type: Number, default: 0, index: true},
tx_type: { type: String, default: null }
}, {id: false});
TxSchema.index({total: 1, total: -1, blockindex: 1, blockindex: -1});
module.exports = mongoose.model('Tx', TxSchema);