fix sighash

This commit is contained in:
NikVolf 2019-05-16 13:34:20 +03:00
parent 45dcc14607
commit cb73ab9142
1 changed files with 1 additions and 1 deletions

View File

@ -179,7 +179,7 @@ impl TransactionInputSigner {
fn signature_hash_sprout(&self, input_index: Option<usize>, script_pubkey: &Script, sighashtype: u32, sighash: Sighash) -> H256 {
let input_index = match input_index {
Some(input_index) if input_index < self.inputs.len() => input_index,
_ => return 1u8.into(),
_ => if sighash.anyone_can_pay || sighash.base == SighashBase::Single { return Default::default(); } else { usize::max_value()-1 },
};
let inputs = if sighash.anyone_can_pay {
let input = &self.inputs[input_index];