mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-17 13:07:54 +02:00
p2sh-wrap peg-in addresses if fedpeg_program is p2sh-wrapped
This commit is contained in:
parent
e2be2356dd
commit
953dd82eae
1 changed files with 4 additions and 2 deletions
|
|
@ -4859,8 +4859,10 @@ UniValue getpeginaddress(const JSONRPCRequest& request)
|
||||||
// Get P2CH deposit address on mainchain from most recent fedpegscript.
|
// Get P2CH deposit address on mainchain from most recent fedpegscript.
|
||||||
const auto& fedpegscripts = GetValidFedpegScripts(chainActive.Tip(), Params().GetConsensus(), true /* nextblock_validation */);
|
const auto& fedpegscripts = GetValidFedpegScripts(chainActive.Tip(), Params().GetConsensus(), true /* nextblock_validation */);
|
||||||
CTxDestination mainchain_dest(WitnessV0ScriptHash(calculate_contract(fedpegscripts.front().second, dest_script)));
|
CTxDestination mainchain_dest(WitnessV0ScriptHash(calculate_contract(fedpegscripts.front().second, dest_script)));
|
||||||
// P2SH-wrapped is the only valid choice for non-dynafed chains
|
// P2SH-wrapped is the only valid choice for non-dynafed chains but still an
|
||||||
if (!IsDynaFedEnabled(chainActive.Tip(), Params().GetConsensus())) {
|
// option for dynafed-enabled ones as well
|
||||||
|
if (!IsDynaFedEnabled(chainActive.Tip(), Params().GetConsensus()) ||
|
||||||
|
fedpegscripts.front().first.IsPayToScriptHash()) {
|
||||||
mainchain_dest = ScriptHash(GetScriptForDestination(mainchain_dest));
|
mainchain_dest = ScriptHash(GetScriptForDestination(mainchain_dest));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue