class Graphdb::Model::TxIn

Public Class Methods

create_from_hash(hash) click to toggle source
# File lib/graphdb/model/tx_in.rb, line 19
def self.create_from_hash(hash)
  tx_in = new
  tx_in.txid = hash['txid']
  tx_in.vout = hash['vout']
  if hash['scriptSig']
    tx_in.script_sig_asm = hash['scriptSig']['asm']
    tx_in.script_sig_hex = hash['scriptSig']['hex']
  end
  tx_in.coinbase = hash['coinbase']
  tx_in.sequence = hash['sequence']
  tx_in.save!
  tx_in
end

Private Instance Methods

add_out_point_rel() click to toggle source
# File lib/graphdb/model/tx_in.rb, line 34
def add_out_point_rel
  return if self.txid.nil? && self.vout.nil?
  tx_out = Graphdb::Model::TxOut.find_by_outpoint(self.txid, self.vout)
  if tx_out
    self.out_point = tx_out
    save!
  end
end