@@ -48,28 +48,6 @@ pub trait SigHashReusedValues {
48
48
fn payload_hash ( & self , set : impl Fn ( ) -> Hash ) -> Hash ;
49
49
}
50
50
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
-
73
51
impl SigHashReusedValues for SigHashReusedValuesUnsync {
74
52
fn previous_outputs_hash ( & self , set : impl Fn ( ) -> Hash ) -> Hash {
75
53
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
204
182
}
205
183
206
184
pub 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
+ }
211
188
189
+ let hash = || {
212
190
let mut hasher = TransactionSigningHash :: new ( ) ;
213
191
hasher. write_var_bytes ( & tx. payload ) ;
214
192
hasher. finalize ( )
0 commit comments