Create OutPoint from hash and n
This commit is contained in:
parent
fab9160b26
commit
885e09a82f
|
@ -28,6 +28,10 @@ pub struct OutPoint {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl OutPoint {
|
impl OutPoint {
|
||||||
|
pub fn new(hash: [u8; 32], n: u32) -> Self {
|
||||||
|
OutPoint { hash, n }
|
||||||
|
}
|
||||||
|
|
||||||
pub fn read<R: Read>(mut reader: R) -> io::Result<Self> {
|
pub fn read<R: Read>(mut reader: R) -> io::Result<Self> {
|
||||||
let mut hash = [0; 32];
|
let mut hash = [0; 32];
|
||||||
reader.read_exact(&mut hash)?;
|
reader.read_exact(&mut hash)?;
|
||||||
|
|
Loading…
Reference in New Issue