Refactor compact block body (#1394)
* introduce CompactBlockBody * rustfmt * implement From<Block> for CompactBlock * rustfmt * remove debug logging * wip * rustfmt
This commit is contained in:
+1
-1
@@ -619,7 +619,7 @@ impl BlockHandler {
|
||||
fn get_compact_block(&self, h: &Hash) -> Result<CompactBlockPrintable, Error> {
|
||||
let block = w(&self.chain).get_block(h).context(ErrorKind::NotFound)?;
|
||||
Ok(CompactBlockPrintable::from_compact_block(
|
||||
&block.as_compact_block(),
|
||||
&block.into(),
|
||||
w(&self.chain),
|
||||
))
|
||||
}
|
||||
|
||||
+3
-3
@@ -601,12 +601,12 @@ impl CompactBlockPrintable {
|
||||
) -> CompactBlockPrintable {
|
||||
let block = chain.get_block(&cb.hash()).unwrap();
|
||||
let out_full = cb
|
||||
.out_full
|
||||
.out_full()
|
||||
.iter()
|
||||
.map(|x| OutputPrintable::from_output(x, chain.clone(), Some(&block.header), false))
|
||||
.collect();
|
||||
let kern_full = cb
|
||||
.kern_full
|
||||
.kern_full()
|
||||
.iter()
|
||||
.map(|x| TxKernelPrintable::from_txkernel(x))
|
||||
.collect();
|
||||
@@ -614,7 +614,7 @@ impl CompactBlockPrintable {
|
||||
header: BlockHeaderPrintable::from_header(&cb.header),
|
||||
out_full,
|
||||
kern_full,
|
||||
kern_ids: cb.kern_ids.iter().map(|x| x.to_hex()).collect(),
|
||||
kern_ids: cb.kern_ids().iter().map(|x| x.to_hex()).collect(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user