Closed wusyong closed 6 years ago
@wusyong, can you propose the expected modifications against existing codebase?
Here is the modification. time_start_pow
is moved inside the loop since every transactions in same bundle are expected to have different attachment timestamp. timestamp_lower_bound
and timestamp_upper_bound
are optional, even api call attachToTangle
from IRI assign 0 and max value separately. So they are assigned same values here. Should I create a pull request?
# attachment_timestamp = time_start_pow
time_start_pow = time.time()
timestamp = TryteString.from_trits(
trits_from_int(int(round(time_start_pow * 1000)), pad=27))
tx_tryte = insert_to_trytes(2619, 2528, str(timestamp), tx_tryte)
# timestamp_lower_bound = 0
# timestamp_upper_bound = MAX_VALUE - 1
timestamp_upper_bound = TryteString("MMMMMMMMM")
tx_tryte = insert_to_trytes(2637, 2646, str(timestamp_upper_bound), tx_tryte)
Edit: Don't know why code snippet doesn't work properly. So just put the code here directly.
Unlike devnet, transaction without
attachment_timestamp
won't be confirm on mainnet even with recent hercules tip-sel algo. I can provide more results if needed. As for now, here's side by side comparison: