Skip to content

Commit

Permalink
Use 0 instead of returning Error in sign script check (paritytech#420)
Browse files Browse the repository at this point in the history
in chainx 1.0, the script check is just use 0, not return error. But in 2.0 I use Error to return directly. However this cause create_withdraw_tx could not create an empty sign tx. Thus, we recover this part to push a zero in result, not return Error directly.
  • Loading branch information
atenjin authored Dec 10, 2020
1 parent c692fda commit 412e808
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion xpallets/gateway/bitcoin/src/tx/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ pub fn parse_and_check_signed_tx_impl<T: Trait>(
let script: Script = tx.inputs[i].script_sig.clone().into();
if script.len() < 2 {
// if script length less than 2, it must has no sig in input, use 0 to represent it
return Err(Error::<T>::InvalidSignCount.into());
input_signs.push(0);
continue;
}
let (sigs, _) = script
.extract_multi_scriptsig()
Expand Down

0 comments on commit 412e808

Please sign in to comment.