Skip to content

Commit

Permalink
Merge bitcoindevkit#1730: Check time when persisting in rusqlite impl
Browse files Browse the repository at this point in the history
8ec9c0a fix(chain): check time when persisting (Rob N)

Pull request description:

  Closes bitcoindevkit#1713

  Any implementation overflowing the `i64` type would be clearly faulty, so I just pass up the error if the conversion fails.

  ### Checklists

  #### All Submissions:

  * [x] I've signed all my commits
  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
  * [x] I ran `cargo fmt` and `cargo clippy` before committing

  #### New Features:

  * [ ] I've added tests for the new feature
  * [ ] I've added docs for the new feature

  #### Bugfixes:

  * [ ] This pull request breaks the existing API
  * [ ] I've added tests to reproduce the issue which are now passing
  * [ ] I'm linking the issue being fixed by this PR

ACKs for top commit:
  notmandatory:
    ACK 8ec9c0a
  oleonardolima:
    utACK 8ec9c0a

Tree-SHA512: ded7c036f7a082e181e52f0366410f572227d57af37fdfd0fc0909f629a48ad1ed69f5c8549c45fe6c7aadb7e3fa62d2b56990028bc7fd321e43d39b79d77b00
  • Loading branch information
notmandatory committed Nov 21, 2024
2 parents e7e552c + 8ec9c0a commit b777396
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/chain/src/rusqlite_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,10 @@ where
Self::TXS_TABLE_NAME,
))?;
for (&txid, &last_seen) in &self.last_seen {
let checked_time = last_seen.to_sql()?;
statement.execute(named_params! {
":txid": Impl(txid),
":last_seen": Some(last_seen),
":last_seen": Some(checked_time),
})?;
}

Expand Down

0 comments on commit b777396

Please sign in to comment.