1
0
mirror of https://github.com/romanz/electrs.git synced 2024-11-19 09:54:09 +01:00

Use WriteStore trait object for Index::update()

This commit is contained in:
Roman Zeyde 2018-05-30 22:33:56 +03:00
parent 32226298e2
commit d08411109f
No known key found for this signature in database
GPG Key ID: 87CAE5FA46917CBB

View File

@ -12,7 +12,7 @@ use std::sync::RwLock;
use std::time::{Duration, Instant};
use daemon::Daemon;
use store::{DBStore, ReadStore, Row, WriteStore};
use store::{ReadStore, Row, WriteStore};
use util::{full_hash, hash_prefix, Bytes, FullHash, HashPrefix, HeaderEntry, HeaderList,
HeaderMap, HASH_PREFIX_LEN};
@ -379,7 +379,7 @@ impl Index {
.cloned()
}
pub fn update(&self, store: &DBStore, daemon: &Daemon) -> Result<Sha256dHash> {
pub fn update(&self, store: &WriteStore, daemon: &Daemon) -> Result<Sha256dHash> {
let tip = daemon.getbestblockhash()?;
let new_headers = daemon.get_new_headers(&self.headers.read().unwrap(), &tip)?;
new_headers.last().map(|tip| {