Skip to content

Commit ea6b83e

Browse files
authored
Small fixes related to enabling payload (#605)
1 parent 64eeb89 commit ea6b83e

File tree

2 files changed

+4
-31
lines changed

2 files changed

+4
-31
lines changed

consensus/core/src/hashing/sighash.rs

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -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-
7351
impl 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

206184
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+
}
211188

189+
let hash = || {
212190
let mut hasher = TransactionSigningHash::new();
213191
hasher.write_var_bytes(&tx.payload);
214192
hasher.finalize()

simpa/Cargo.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,3 @@ tokio = { workspace = true, features = ["rt", "macros", "rt-multi-thread"] }
4040
[features]
4141
heap = ["dhat", "kaspa-alloc/heap"]
4242
semaphore-trace = ["kaspa-utils/semaphore-trace"]
43-
44-
[profile.heap]
45-
inherits = "release"
46-
debug = true
47-
strip = false

0 commit comments

Comments
 (0)