mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 20:29:23 +00:00
3.10 Remove use of Network::Bitcoin
All uses were safe due to addresses being converted to script_pubkeys which don't embed their network. The only risk of there being an issue is if a future address spec did embed the net ID into the script_pubkey and that was moved to. This resolves the audit note and does offer that tightening.
This commit is contained in:
@@ -16,12 +16,12 @@ use bitcoin::{
|
||||
sighash::{TapSighashType, SighashCache, Prevouts},
|
||||
absolute::LockTime,
|
||||
script::{PushBytesBuf, ScriptBuf},
|
||||
OutPoint, Sequence, Witness, TxIn, TxOut, Transaction, Network, Address,
|
||||
OutPoint, Sequence, Witness, TxIn, TxOut, Transaction, Address,
|
||||
};
|
||||
|
||||
use crate::{
|
||||
crypto::Schnorr,
|
||||
wallet::{address, ReceivedOutput},
|
||||
wallet::{ReceivedOutput, address_payload},
|
||||
};
|
||||
|
||||
#[rustfmt::skip]
|
||||
@@ -226,9 +226,7 @@ impl SignableTransaction {
|
||||
transcript.append_message(b"signing_input", u32::try_from(i).unwrap().to_le_bytes());
|
||||
|
||||
let offset = keys.clone().offset(self.offsets[i]);
|
||||
if address(Network::Bitcoin, offset.group_key())?.script_pubkey() !=
|
||||
self.prevouts[i].script_pubkey
|
||||
{
|
||||
if address_payload(offset.group_key())?.script_pubkey() != self.prevouts[i].script_pubkey {
|
||||
None?;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user