3.9/3.10. 3.9: Remove cast which fails on a several GB malicious TX

3.10 has its impossibility documented. A malicious RPC cananot effect this code.
This commit is contained in:
Luke Parker
2023-07-10 14:43:46 -04:00
parent fa1b569b78
commit 677b9b681f
2 changed files with 8 additions and 1 deletions

View File

@@ -221,6 +221,8 @@ impl SignableTransaction {
let mut sigs = vec![];
for i in 0 .. tx.input.len() {
let mut transcript = transcript.clone();
// This unwrap is safe since any transaction with this many inputs violates the maximum
// size allowed under standards, which this lib will error on creation of
transcript.append_message(b"signing_input", u32::try_from(i).unwrap().to_le_bytes());
let offset = keys.clone().offset(self.offsets[i]);