@@ -48,28 +48,6 @@ pub trait SigHashReusedValues {
4848 fn payload_hash ( & self , set : impl Fn ( ) -> Hash ) -> Hash ;
4949}
5050
51- impl < T : SigHashReusedValues > SigHashReusedValues for Arc < T > {
52- fn previous_outputs_hash ( & self , set : impl Fn ( ) -> Hash ) -> Hash {
53- self . as_ref ( ) . previous_outputs_hash ( set)
54- }
55-
56- fn sequences_hash ( & self , set : impl Fn ( ) -> Hash ) -> Hash {
57- self . as_ref ( ) . sequences_hash ( set)
58- }
59-
60- fn sig_op_counts_hash ( & self , set : impl Fn ( ) -> Hash ) -> Hash {
61- self . as_ref ( ) . sig_op_counts_hash ( set)
62- }
63-
64- fn outputs_hash ( & self , set : impl Fn ( ) -> Hash ) -> Hash {
65- self . as_ref ( ) . outputs_hash ( set)
66- }
67-
68- fn payload_hash ( & self , set : impl Fn ( ) -> Hash ) -> Hash {
69- self . as_ref ( ) . outputs_hash ( set)
70- }
71- }
72-
7351impl SigHashReusedValues for SigHashReusedValuesUnsync {
7452 fn previous_outputs_hash ( & self , set : impl Fn ( ) -> Hash ) -> Hash {
7553 self . previous_outputs_hash . get ( ) . unwrap_or_else ( || {
@@ -204,11 +182,11 @@ pub fn sig_op_counts_hash(tx: &Transaction, hash_type: SigHashType, reused_value
204182}
205183
206184pub fn payload_hash ( tx : & Transaction , reused_values : & impl SigHashReusedValues ) -> Hash {
207- let hash = || {
208- if tx. subnetwork_id . is_native ( ) && tx. payload . is_empty ( ) {
209- return ZERO_HASH ;
210- }
185+ if tx. subnetwork_id . is_native ( ) && tx. payload . is_empty ( ) {
186+ return ZERO_HASH ;
187+ }
211188
189+ let hash = || {
212190 let mut hasher = TransactionSigningHash :: new ( ) ;
213191 hasher. write_var_bytes ( & tx. payload ) ;
214192 hasher. finalize ( )
0 commit comments