Statistics
| Branch: | Revision:

streamers / transaction.h @ c7c42215

History | View | Annotate | Download (848 Bytes)

1 84ec8c3a Csaba Kiraly
/*
2
 *  Copyright (c) 2010 Stefano Traverso
3
 *  Copyright (c) 2010 Csaba Kiraly
4
 *
5
 *  This is free software; see gpl-3.0.txt
6
 */
7
8
#ifndef TRANSACTION_H
9
#define TRANSACTION_H
10
11
/* timeout of the offers thread. If it is not updated, it is deleted */
12
#define TRANS_ID_MAX_LIFETIME 1.0
13
14
struct nodeID;
15
16
// register the moment when a transaction is started
17
// return a  new transaction id
18
uint16_t transaction_create(struct nodeID *id);
19
20
// Add the moment I received a positive select in a list
21
// return true if a valid trans_id is found
22
bool transaction_reg_accept(uint16_t trans_id, struct nodeID *id);
23
24
// Used to get the time elapsed from the moment I get a positive select to the moment i get the ACK
25
// related to the same chunk
26
// it return -1.0 in case no trans_id is found
27
double transaction_remove(uint16_t trans_id);
28
29
#endif // TRANSACTION_H