transaction::Builder::add_transparent_input()

This commit is contained in:
Jack Grigg
2019-07-31 16:20:13 +01:00
parent 70857b0eed
commit 3425eabda2
4 changed files with 149 additions and 3 deletions

View File

@@ -44,11 +44,20 @@ impl OutPoint {
#[derive(Debug)]
pub struct TxIn {
pub prevout: OutPoint,
script_sig: Script,
pub script_sig: Script,
pub sequence: u32,
}
impl TxIn {
#[cfg(feature = "transparent-inputs")]
pub fn new(prevout: OutPoint) -> Self {
TxIn {
prevout,
script_sig: Script::default(),
sequence: std::u32::MAX,
}
}
pub fn read<R: Read>(mut reader: &mut R) -> io::Result<Self> {
let prevout = OutPoint::read(&mut reader)?;
let script_sig = Script::read(&mut reader)?;