Commit 36c1dee3 authored by Mateusz Tyszczak's avatar Mateusz Tyszczak Committed by Dan Notestein
Browse files

fixup! Change transaction expiration time generation in the converter

parent 2ad42a25
......@@ -40,7 +40,7 @@ head block time and the timestamp of the block that is currently being converted
min(
// Try to match relative expiration time of original transaction to including block, unless it would be so short that transaction would likely expire. After more thought, I'm starting to question the logic on this, maybe we would prefer if these transactions don't expire if at all possible (after all, they got into mainnet). But let's leave this as-is for now.
max( block_to_convert.timestamp + trx_time_offset - HIVE_BLOCK_INTERVAL, transaction_to_convert.expiration + trx_time_offset),
block_to_convert.timestamp + HIVE_MAX_TIME_UNTIL_EXPIRATION - HIVE_BLOCK_INTERVAL
now_time - HIVE_BLOCK_INTERVAL + HIVE_MAX_TIME_UNTIL_EXPIRATION
)
```
......
......@@ -310,7 +310,7 @@ namespace hive { namespace converter {
current_block_ptr = &_signed_block;
fc::microseconds trx_time_offset = _signed_block.timestamp - now_time;
fc::microseconds trx_time_offset = now_time - _signed_block.timestamp;
const auto apply_trx_expiration_offset = [&](hp::transaction& trx) {
// Add transactoin time offset to avoid txids duplication
......@@ -320,7 +320,7 @@ namespace hive { namespace converter {
trx.expiration = std::min(
// Apply either minimum transaction expiration value or the desired one
std::max(_signed_block.timestamp + trx_time_offset - fc::seconds(HIVE_BLOCK_INTERVAL), trx.expiration + trx_time_offset),
_signed_block.timestamp + fc::seconds(HIVE_MAX_TIME_UNTIL_EXPIRATION - HIVE_BLOCK_INTERVAL)
now_time + fc::seconds(HIVE_MAX_TIME_UNTIL_EXPIRATION - HIVE_BLOCK_INTERVAL)
);
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment