dev of mixins_time_scale method started
This commit is contained in:
parent
72279c5340
commit
f608ed3b81
37
src/page.h
37
src/page.h
|
@ -543,6 +543,43 @@ namespace xmreg {
|
|||
return txd;
|
||||
}
|
||||
|
||||
string
|
||||
mixins_time_scale(const vector<uint64_t>& timestamps)
|
||||
{
|
||||
string empty_time = string("___________________________________")
|
||||
+ string("___________________________________")
|
||||
+ string("___________________________________")
|
||||
+ string("___________________________________");
|
||||
|
||||
size_t time_axis_length = empty_time.size();
|
||||
|
||||
cout << "time_axis_length: " << time_axis_length << endl;
|
||||
|
||||
uint64_t time0 = 10;
|
||||
uint64_t timeN = 30;
|
||||
|
||||
uint64_t interval_length = timeN-time0;
|
||||
|
||||
double scale = double(interval_length) / double(time_axis_length);
|
||||
|
||||
for (const auto& timestamp: timestamps)
|
||||
{
|
||||
|
||||
if (timestamp < time0 || timestamp > timeN)
|
||||
{
|
||||
cout << "Out of range" << endl;
|
||||
continue;
|
||||
}
|
||||
|
||||
uint64_t timestamp_place = double(timestamp-time0)/double(interval_length)*(time_axis_length-1);
|
||||
//cout << timestamp_place << endl;
|
||||
empty_time[timestamp_place] = '*';
|
||||
}
|
||||
|
||||
return string("Genesis ") + empty_time + string(" Now");
|
||||
}
|
||||
|
||||
|
||||
pair<string, string>
|
||||
get_age(uint64_t timestamp1, uint64_t timestamp2)
|
||||
{
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
<table class="center" style="width:80%">
|
||||
<tr>
|
||||
<td>hash</td>
|
||||
<td>inputs/outputs</td>
|
||||
<td>outputs</td>
|
||||
<td>fee</td>
|
||||
<td>mixin no</td>
|
||||
<td>size [kB]</td>
|
||||
|
@ -67,7 +67,7 @@
|
|||
{{#blk_txs}}
|
||||
<tr>
|
||||
<td>{{hash}}</td>
|
||||
<td>{{sum_inputs}}/{{sum_outputs}}</td>
|
||||
<td>{{sum_outputs}}</td>
|
||||
<td>{{tx_fee}}</td>
|
||||
<td>{{mixin}}</td>
|
||||
<td>{{tx_size}}</td>
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
<td>block hash</td>
|
||||
<td>reward/fees</td>
|
||||
<td>txs</td>
|
||||
<td>inputs/outputs</td>
|
||||
<td>outputs</td>
|
||||
<td>mixins</td>
|
||||
<td>size [kB]</td>
|
||||
</tr>
|
||||
|
@ -42,7 +42,7 @@
|
|||
<td><a href="/block/{{hash}}">{{hash}}</a></td>
|
||||
<td>{{block_reward}}</td>
|
||||
<td>{{notx}}</td>
|
||||
<td>{{xmr_inputs}}/{{xmr_outputs}}</td>
|
||||
<td>{{xmr_outputs}}</td>
|
||||
<td>{{mixin_range}}</td>
|
||||
<td>{{blksize}}</td>
|
||||
</tr>
|
||||
|
|
Loading…
Reference in New Issue