mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-13 12:33:42 +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.
|
||||
const auto& fedpegscripts = GetValidFedpegScripts(chainActive.Tip(), Params().GetConsensus(), true /* nextblock_validation */);
|
||||
CTxDestination mainchain_dest(WitnessV0ScriptHash(calculate_contract(fedpegscripts.front().second, dest_script)));
|
||||
// P2SH-wrapped is the only valid choice for non-dynafed chains
|
||||
if (!IsDynaFedEnabled(chainActive.Tip(), Params().GetConsensus())) {
|
||||
// P2SH-wrapped is the only valid choice for non-dynafed chains but still an
|
||||
// option for dynafed-enabled ones as well
|
||||
if (!IsDynaFedEnabled(chainActive.Tip(), Params().GetConsensus()) ||
|
||||
fedpegscripts.front().first.IsPayToScriptHash()) {
|
||||
mainchain_dest = ScriptHash(GetScriptForDestination(mainchain_dest));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue