public void Set(long txId, TxStatus status, long commitTime, long commitLowerBound) { this.TxId = txId; this.Status = status; this.CommitTime = commitTime; this.CommitLowerBound = commitLowerBound; }
public Transaction( ILogStore logStore, VersionDb versionDb, long txId = -1, Queue <long> garbageQueueTxId = null, Queue <long> garbageQueueFinishTime = null) { this.logStore = logStore; this.versionDb = versionDb; this.readSet = new Dictionary <string, Dictionary <object, ReadSetEntry> >(); this.writeSet = new Dictionary <string, Dictionary <object, object> >(); this.abortSet = new Dictionary <string, Dictionary <object, List <PostProcessingEntry> > >(); this.commitSet = new Dictionary <string, Dictionary <object, List <PostProcessingEntry> > >(); this.largestVersionKeyMap = new Dictionary <string, Dictionary <object, long> >(); this.validationVersions = new List <Tuple <string, object, VersionEntry> >(); this.txId = txId < 0 ? this.versionDb.InsertNewTx() : txId; this.txStatus = TxStatus.Ongoing; this.commitTs = TxTableEntry.DEFAULT_COMMIT_TIME; this.maxCommitTsOfWrites = -1L; this.beginTimestamp = Transaction.DEFAULT_TX_BEGIN_TIMESTAMP; this.garbageQueueTxId = garbageQueueTxId; this.garbageQueueFinishTime = garbageQueueFinishTime; }
public void Set(long txId, TxStatus status, TxTableEntry remoteEntry = null) { this.TxId = txId; this.SenderId = txId; this.TxStatus = status; this.RemoteTxEntry = remoteEntry; }
public TxTableEntry(long txId, TxStatus status, long commitTime, long commitLowerBound) { this.TxId = txId; this.Status = status; this.CommitTime = commitTime; this.CommitLowerBound = commitLowerBound; }
public void Clear(long txId) { this.readSet.Clear(); this.writeSet.Clear(); this.abortSet.Clear(); this.commitSet.Clear(); this.largestVersionKeyMap.Clear(); this.validationVersions.Clear(); this.txId = txId; this.txStatus = TxStatus.Ongoing; this.commitTs = TxTableEntry.DEFAULT_COMMIT_TIME; this.maxCommitTsOfWrites = -1L; this.beginTimestamp = Transaction.DEFAULT_TX_BEGIN_TIMESTAMP; }
public async Task UpdateStatusAsync(string id, TxStatus status) { using (var context = _contextFactory.CreateDataContext()) { var entity = await context.TransactionReports.FindAsync(Guid.Parse(id)); if (entity == null) { throw new InvalidOperationException($"Could find operation with id = {id}"); } entity.Status = status.ToString(); context.Update(entity); await context.SaveChangesAsync(); } }
public Transaction Confirm(String txHash, int maxAttempts, int interval) { this.Status = TxStatus.Pending; for (int i = 0; i < maxAttempts; i++) { bool tracked = this.TrackTx(txHash); Thread.Sleep(interval * 1000); if (tracked) { this.Status = TxStatus.Confirmed; return(this); } } this.Status = TxStatus.Rejected; return(this); }
public bool TrackTx(string txHash) { Transaction response; try { response = this.Provider.GetTransaction(txHash).Result; } catch (IOException e) { Console.WriteLine("transaction not confirmed yet"); return(false); } if (null == response) { Console.WriteLine("transaction not confirmed yet"); return(false); } this.ID = response.ID; this.Receipt = response.Receipt; if (response.Receipt != null && response.Receipt.Success) { Console.WriteLine("Transaction confirmed!"); this.Status = TxStatus.Confirmed; } else { this.Status = TxStatus.Rejected; Console.WriteLine("Transaction rejected!"); } return(true); }
private void FilterUTXO_Checked(object sender, RoutedEventArgs e) { filterOff = false; filterStatus = TxStatus.UTXO; Refresh(); }
private void FilterReceived_Checked(object sender, RoutedEventArgs e) { filterOff = false; filterStatus = TxStatus.Received; Refresh(); }
public TxResult(TxStatus status, long?blockIndex, string?blockHash) { TxStatus = status; BlockIndex = blockIndex; BlockHash = blockHash; }
public UpdateTxStatusRequest(long txId, TxStatus status) : base(txId) { this.TxStatus = status; }
public static Transaction BuildTransaction(TxParams param, HttpProvider provider, TxStatus status) { return(new Transaction() { ID = param.ID, Version = param.Version, Nonce = param.Nonce, Amount = param.Amount, GasPrice = param.GasPrice, GasLimit = param.GasLimit, Signature = param.Signature, Receipt = param.Receipt, SenderPubKey = param.SenderPubKey, ToAddr = param.ToAddr, Code = param.Code, Data = param.Data, Provider = provider, Status = status, }); }
public override void Parse(IPacketParser parser) { base.Parse(parser); Status = (TxStatus)parser.Read("TX Status"); }