datastructures/blockchain.rb
# Save the current transactions as a JSON file
Save the current transactions as a JSON file
Save the current transactions as a JSON file
def save_transactions
    FileUtils.mkdir_p("data") unless Dir.exists?("data")
    File.open("data/pending_transactions.json","w") do |f|
      f.write(@current_transactions.to_json)
    end
  end
def save_transactions FileUtils . mkdir_p ( "data" ) unless Dir . exists? ( "data" ) File . open ( "data/pending_transactions.json" , "w" ) do | f | f . write ( @current_transactions . to_json ) end end
Save the current transactions as a JSON file
Save the current transactions as a JSON file