mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 14:08:40 +01:00
Make WitnessUnknown members private
Make sure that nothing else can change WitnessUnknown's data members by making them private. Also change the program to use a vector rather than C-style array.
This commit is contained in:
@@ -87,11 +87,7 @@ bool ExtractDestination(const CScript& scriptPubKey, CTxDestination& addressRet)
|
||||
return true;
|
||||
}
|
||||
case TxoutType::WITNESS_UNKNOWN: {
|
||||
WitnessUnknown unk;
|
||||
unk.version = vSolutions[0][0];
|
||||
std::copy(vSolutions[1].begin(), vSolutions[1].end(), unk.program);
|
||||
unk.length = vSolutions[1].size();
|
||||
addressRet = unk;
|
||||
addressRet = WitnessUnknown{vSolutions[0][0], vSolutions[1]};
|
||||
return true;
|
||||
}
|
||||
case TxoutType::MULTISIG:
|
||||
@@ -138,7 +134,7 @@ public:
|
||||
|
||||
CScript operator()(const WitnessUnknown& id) const
|
||||
{
|
||||
return CScript() << CScript::EncodeOP_N(id.version) << std::vector<unsigned char>(id.program, id.program + id.length);
|
||||
return CScript() << CScript::EncodeOP_N(id.GetWitnessVersion()) << id.GetWitnessProgram();
|
||||
}
|
||||
};
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user