Skip to content

Commit

Permalink
Convert to millis
Browse files Browse the repository at this point in the history
  • Loading branch information
casey committed Nov 22, 2022
1 parent f17c88f commit fb69f3c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ mod updater;

const HEIGHT_TO_BLOCK_HASH: TableDefinition<u64, [u8; 32]> =
TableDefinition::new("HEIGHT_TO_BLOCK_HASH");
const WRITE_TRANSACTION_STARTING_BLOCK_COUNT_TO_TIMESTAMP: TableDefinition<u64, u64> =
const WRITE_TRANSACTION_STARTING_BLOCK_COUNT_TO_TIMESTAMP: TableDefinition<u64, u128> =
TableDefinition::new("WRITE_TRANSACTION_START_BLOCK_COUNT_TO_TIMESTAMP");
const ORDINAL_TO_INSCRIPTION_TXID: TableDefinition<u64, [u8; 32]> =
TableDefinition::new("ORDINAL_TO_INSCRIPTION_TXID");
Expand Down Expand Up @@ -98,7 +98,7 @@ pub(crate) struct Info {
#[derive(Serialize)]
pub(crate) struct TransactionInfo {
pub(crate) starting_block_count: u64,
pub(crate) starting_timestamp: u64,
pub(crate) starting_timestamp: u128,
}

trait BitcoinCoreRpcResultExt<T> {
Expand Down
4 changes: 2 additions & 2 deletions src/index/updater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ impl Updater {
&height,
&SystemTime::now()
.duration_since(SystemTime::UNIX_EPOCH)
.map(|duration| duration.as_secs())
.map(|duration| duration.as_millis())
.unwrap_or(0),
)?;

Expand Down Expand Up @@ -108,7 +108,7 @@ impl Updater {
&self.height,
&SystemTime::now()
.duration_since(SystemTime::UNIX_EPOCH)
.map(|duration| duration.as_secs())
.map(|duration| duration.as_millis())
.unwrap_or(0),
)?;
uncomitted = 0;
Expand Down

0 comments on commit fb69f3c

Please sign in to comment.