Add OutPoint::new() for one-liner construction (#285)

This commit is contained in:
Steven Roose 2019-06-24 17:49:20 +01:00 committed by Tamás Blummer
parent b13e4628f9
commit 560a709faa
1 changed files with 9 additions and 0 deletions

View File

@ -48,6 +48,15 @@ pub struct OutPoint {
serde_struct_impl!(OutPoint, txid, vout);
impl OutPoint {
/// Create a new [OutPoint].
#[inline]
pub fn new(txid: sha256d::Hash, vout: u32) -> OutPoint {
OutPoint {
txid: txid,
vout: vout,
}
}
/// Creates a "null" `OutPoint`.
///
/// This value is used for coinbase transactions because they don't have