Add OutPoint::new() for one-liner construction (#285)
This commit is contained in:
parent
b13e4628f9
commit
560a709faa
|
@ -48,6 +48,15 @@ pub struct OutPoint {
|
||||||
serde_struct_impl!(OutPoint, txid, vout);
|
serde_struct_impl!(OutPoint, txid, vout);
|
||||||
|
|
||||||
impl OutPoint {
|
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`.
|
/// Creates a "null" `OutPoint`.
|
||||||
///
|
///
|
||||||
/// This value is used for coinbase transactions because they don't have
|
/// This value is used for coinbase transactions because they don't have
|
||||||
|
|
Loading…
Reference in New Issue