fix v2 conversion to ensure we provide blocks in correct format (#3465)

This commit is contained in:
Antioch Peverell 2020-10-08 09:27:00 +01:00 committed by GitHub
parent cf2a65242d
commit 145c2874f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -372,8 +372,8 @@ where
self.chain() self.chain()
.get_block(&h) .get_block(&h)
.map(|b| match peer_info.version.value() { .map(|b| match peer_info.version.value() {
0..=2 => Some(b), 0..=2 => self.chain().convert_block_v2(b).ok(),
3..=ProtocolVersion::MAX => self.chain().convert_block_v2(b).ok(), 3..=ProtocolVersion::MAX => Some(b),
}) })
.unwrap_or(None) .unwrap_or(None)
} }