Orphan
@constructor
@ignore
@param {TX} tx
@param {Hash[]} missing
@param {Number} id
960076
function Orphan(tx, missing, id) {
  this.raw = tx.toRaw();
  this.missing = missing;
  this.id = id;
}
231133
def get_tx(txid, use_cache = true)
      decode_tx = use_cache ? load_cached_tx(txid) : load_tx(txid)
      Bitcoin::Protocol::Tx.new(decode_tx.htb)
    end
756773
function unpackTx (tx) {
  const deserializedTx = TxBuilder.unpackTx(tx)
  console.log(JSON.stringify(deserializedTx, undefined, 2))
}
30736
function IDBTransaction(db, storeNames, mode) {
        this.__id = ++uniqueID; // for debugging simultaneous transactions
        this.__active = true;
        this.__running = false;
        this.__errored = false;
        this.__requests = [];
        this.__storeNames = storeNames;
        this.mode = mode;
        this.db = db;
        this.error = null;
        this.onabort = this.onerror = this.oncomplete = null;

        // Kick off the transaction as soon as all synchronous code is done.
        var me = this;
        setTimeout(function() { me.__executeRequests(); }, 0);
    }
1047692
function(e) {
    goog.log.finest(me.logger, me + ': Tx ' + mode + ' request cause error.');
    // NOTE: we have to call ABORT, instead of ERROR, here.
    // IndexedDB API use COMPLETE or ABORT as promise callbacks.
    // ERROR is just an event.
    completed_event_handler(ydn.db.base.TxEventTypes.ABORT, e);
  }
418742
function TXDB(wallet) {
  if (!(this instanceof TXDB))
    return new TXDB(wallet);

  this.wallet = wallet;
  this.walletdb = wallet.db;
  this.db = wallet.db.db;
  this.logger = wallet.db.logger;
  this.network = wallet.db.network;
  this.options = wallet.db.options;
  this.coinCache = new LRU(10000);

  this.locked = new Set();
  this.state = null;
  this.pending = null;
  this.events = [];
}
1047456
def _delete(self, tx_id):
        
        txs = self.driver.instance.transactions.get(asset_id=self.get_asset_id(tx_id))
        unspent = txs[-1]
        output_index = 0
        output = unspent['outputs'][output_index]

        transfer_input = {
            'fulfillment': output['condition']['details'],
            'fulfills': {
                'output_index': output_index,
                'transaction_id': unspent['id']
            },
            'owners_before': output['public_keys']
        }

        prepared_transfer_tx = self.driver.instance.transactions.prepare(
            operation='TRANSFER',
            asset=unspent['asset'] if 'id' in unspent['asset'] else {'id': unspent['id']},
            inputs=transfer_input,
            recipients=self.BURN_ADDRESS,
            metadata={
                'namespace': 'burned',

            }
        )
        signed_tx = self.driver.instance.transactions.fulfill(
            prepared_transfer_tx,
            private_keys=self.user.private_key,
        )
        self.driver.instance.transactions.send_commit(signed_tx)
824251
function insertQueryError(err, tx) {
        CRUD.stats.writesExecuted++;
        console.error("Insert query error: ", err);
        return err;
    }
1048170
function BalanceDetails(txdb, wid, id, account) {
  if (!(this instanceof BalanceDetails))
    return new BalanceDetails(wid, id, account);

  this.wid = wid;
  this.id = id;
  this.account = account;
  this.chainHeight = txdb.walletdb.state.height;
  this.total = 0;
  this.available = 0;
  this.pending = 0;
  this.immature = 0;
}
521153
function (data, callback) {
    if (txCharacteristic === undefined) return;

    if (data.length>NORDIC_TX_MAX_LENGTH) {
      console.error("BT> TX length >"+NORDIC_TX_MAX_LENGTH);
      return callback();
    }
    if (txInProgress) {
      console.error("BT> already sending!");
      return callback();
    }

    console.log("BT> send "+JSON.stringify(data));
    txInProgress = true;
    try {
      txCharacteristic.write(Espruino.Core.Utils.stringToBuffer(data), false, function() {
        txInProgress = false;
        return callback();
      });
    } catch (e) {
      console.log("BT> SEND ERROR " + e);
      closeSerial();
    }
  }
519032
function createDatabase_other(tx) {
    var schema = "clicks_other (id integer primary key, other text)"
    var sql = "create table if not exists " + schema

    tx.executeSql(sql, null, null, sqlError);
}
434685
def get_transaction_by_id(cls, txid):
        

        for api_call in cls.GET_TRANSACTION_BY_ID_MAIN:
            try:
                return api_call(txid)
            except cls.IGNORED_ERRORS:
                pass

        raise ConnectionError('All APIs are unreachable.')
846056
synchronized List<Long> addUpdates(long txId, TxContext txContext, boolean isTrialRun) {
		if (isSingleSession) {
			//no need to record history
			return null;
		}
		
		ArrayList<TxObjInfo> updatesAndDeletes = txContext.getUpdatesAndDeletes();
		
		//first, check for conflicts
		ArrayList<Long> conflicts = null;
		for (TxObjInfo clientInfo: updatesAndDeletes) {
			long oid = clientInfo.getOid();
			long ots = clientInfo.getTS();
			//At this point we should not ignore objects that are apparently new!
			//Why? Even if the object appears new, the OID may be in use, which 
			//may present a conflict.

			TxObjInfo serverInfo = updateSummary.get(oid);
			//OLD:
			//Did the current transaction begin before the other was committed?
			//I.e. is the updateTimeStamp higher than the readTimeStamp of the current TX?
			//NEW: We just check whether the cached TS equals the expected TS. 
			//If not, we have a conflict. Note, that the new timestamp may be LOWER than the
			//cached timestamp if the object was updated AFTER the current TX started, but
			//before the current TX first accessed the object.
			//System.out.println("TxM-au: " + oid + " ots=" + ots + "   txTS=" + (serverInfo != null?serverInfo.getTS():"null"));
			if (serverInfo != null && serverInfo.getTxId() != ots) {
				if (clientInfo.isDeleted() && serverInfo.isDeleted()) {
					//okay, ignore
					//continue;
					//TODO For now we don't ignore these. To ignore these, we have to report back
					//so that there will be no attempts on updating any indexes. Furthermore,
					//it is not obvious that this is the right thing to do, because the TX may 
					//semantically rely on having deleted an object, however the object is already 
					//gone (for example if the number of deleted objects counts).
				}
				if (conflicts == null) {
					conflicts = new ArrayList<>();
				}
				conflicts.add(oid);
			}
		}
		if (conflicts != null || isTrialRun) {
			return conflicts;
		}
		
		//apply updates
		updateHistory.put(txId, updatesAndDeletes);
		for (TxObjInfo info: updatesAndDeletes) {
			// +1 to ensure conflicts even with latest transaction
			info.setTxId(txId);
			updateSummary.put(info.getOid(), info);
		}
		//not very clean: 'null' indicates no conflicts.
		return null;
	}
735725
void writeTransactionIdFile(StorageDirectory sd, long txid) throws IOException {
    if (txid < -1) {
      // -1 is valid when formatting
      throw new IOException("Bad txid: " + txid);
    }
    File txIdFile = getStorageFile(sd, NameNodeFile.SEEN_TXID);
    OutputStream fos = new AtomicFileOutputStream(txIdFile);
    try {
      fos.write(String.valueOf(txid).getBytes());
      fos.write('\n');
      fos.close();
      fos = null;
    } finally {
      IOUtils.cleanup(LOG, fos);
    }
  }
71687
function TXRecord(tx, block) {
  if (!(this instanceof TXRecord))
    return new TXRecord(tx, block);

  this.tx = null;
  this.hash = null;
  this.mtime = util.now();
  this.height = -1;
  this.block = null;
  this.index = -1;
  this.time = 0;

  if (tx)
    this.fromTX(tx, block);
}
255118
def tx_serialization_order(provider: Provider, blockhash: str, txid: str) -> int:
    ''''''

    return provider.getblock(blockhash)["tx"].index(txid)
270819
def nack(self, id, transaction=None, receipt=None):
        
        assert id is not None, "'id' is required"
        headers = {HDR_ID: id}
        if transaction:
            headers[HDR_TRANSACTION] = transaction
        if receipt:
            headers[HDR_RECEIPT] = receipt
        self.send_frame(CMD_NACK, headers)