mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
Add support for NullData addresses (OP_RETURN)
This commit is contained in:
parent
18ee3417d8
commit
ac1eadd0de
4 changed files with 41 additions and 1 deletions
|
|
@ -177,6 +177,11 @@ bool ExtractDestination(const CScript& scriptPubKey, CTxDestination& addressRet)
|
|||
if (!Solver(scriptPubKey, whichType, vSolutions))
|
||||
return false;
|
||||
|
||||
if (whichType == TX_NULL_DATA) {
|
||||
// This is data, not addresses
|
||||
return false;
|
||||
}
|
||||
|
||||
if (whichType == TX_PUBKEY)
|
||||
{
|
||||
CPubKey pubKey(vSolutions[0]);
|
||||
|
|
@ -303,6 +308,16 @@ public:
|
|||
*script << CScript::EncodeOP_N(id.version) << std::vector<unsigned char>(id.program, id.program + id.length);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool operator()(const NullData& id) const
|
||||
{
|
||||
script->clear();
|
||||
*script << OP_RETURN;
|
||||
for (const auto& push : id.null_data) {
|
||||
*script << push;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
} // namespace
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue