Esempio n. 1
0
  public void commit(CBlockPayload block) throws Exception {
    // Superclass
    super.commit(block);

    // Commit
    UTILS.DB.executeUpdate(
        "INSERT INTO comments "
            + "SET adr='"
            + this.target_adr
            + "',"
            + "parent_type='"
            + this.parent_type
            + "', "
            + "parentID='"
            + this.parentID
            + "', "
            + "comID='"
            + this.comID
            + "', "
            + "mes='"
            + UTILS.BASIC.base64_encode(this.mes)
            + "', "
            + "expire='"
            + (this.block + 43200)
            + "', "
            + "block='"
            + this.block
            + "'");

    // Post ?
    if (this.parent_type.equals("ID_POST"))
      UTILS.DB.executeUpdate(
          "UPDATE tweets " + "SET comments=comments+1 " + "WHERE tweetID='" + this.parentID + "'");
  }
  public void commit(CBlockPayload block) throws Exception {
    // Superclass
    super.commit(block);

    // Insert asset
    UTILS.DB.executeUpdate(
        "INSERT INTO assets "
            + "SET adr='"
            + this.target_adr
            + "', "
            + "assetID='"
            + this.assetID
            + "', "
            + "symbol='"
            + this.symbol
            + "', "
            + "title='"
            + UTILS.BASIC.base64_encode(this.title)
            + "', "
            + "description='"
            + UTILS.BASIC.base64_encode(this.description)
            + "', "
            + "how_buy='"
            + UTILS.BASIC.base64_encode(this.how_buy)
            + "', "
            + "how_sell='"
            + UTILS.BASIC.base64_encode(this.how_sell)
            + "', "
            + "web_page='"
            + UTILS.BASIC.base64_encode(this.web_page)
            + "', "
            + "pic='"
            + UTILS.BASIC.base64_encode(this.pic)
            + "', "
            + "expire='"
            + (this.block + (1440 * this.days))
            + "', "
            + "qty='"
            + this.qty
            + "', "
            + "trans_fee_adr='"
            + this.trans_fee_adr
            + "', "
            + "trans_fee='"
            + UTILS.FORMAT_2.format(this.trans_fee)
            + "', "
            + "block='"
            + this.block
            + "'");

    // Update
    UTILS.DB.executeUpdate(
        "INSERT INTO assets_owners "
            + "SET owner='"
            + this.target_adr
            + "', "
            + "symbol='"
            + this.symbol
            + "', "
            + "qty='"
            + this.qty
            + "', "
            + "block='"
            + this.block
            + "'");
  }