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

Support latest bitcoind mempool entry vsize field name

It was changed by https://github.com/bitcoin/bitcoin/pull/15637.
This commit is contained in:
Roman Zeyde 2019-04-04 11:06:30 +03:00
parent e9c06d816a
commit 1167cbfb04
No known key found for this signature in database
GPG Key ID: 87CAE5FA46917CBB

View File

@ -568,9 +568,10 @@ impl Daemon {
* 100_000_000f64) as u64;
let vsize = entry
.get("size")
.chain_err(|| "missing size")?
.or_else(|| entry.get("vsize")) // (https://github.com/bitcoin/bitcoin/pull/15637)
.chain_err(|| "missing vsize")?
.as_u64()
.chain_err(|| "non-integer size")? as u32;
.chain_err(|| "non-integer vsize")? as u32;
Ok(MempoolEntry::new(fee, vsize))
}