diff --git a/coins/monero/src/block.rs b/coins/monero/src/block.rs index 2bced983b..895c4e6e1 100644 --- a/coins/monero/src/block.rs +++ b/coins/monero/src/block.rs @@ -114,9 +114,16 @@ impl Block { } pub fn read(r: &mut R) -> io::Result { + let header = BlockHeader::read(r)?; + + let miner_tx = Transaction::read(r)?; + if !matches!(miner_tx.prefix.inputs.as_slice(), &[Input::Gen(_)]) { + Err(io::Error::other("Miner transaction has incorrect input type."))?; + } + Ok(Block { - header: BlockHeader::read(r)?, - miner_tx: Transaction::read(r)?, + header, + miner_tx, txs: (0_usize .. read_varint(r)?).map(|_| read_bytes(r)).collect::>()?, }) }