Skip to content

Commit 7cc7822

Browse files
committed
rpc: Use FlatSigningProvider in decodescript
Using a FillableSigningProvider results in decodescript being unable to infer descriptors for scripts larger than 520 bytes. Using a FlatSigningProvider resolves this.
1 parent 75f0e0b commit 7cc7822

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/rpc/rawtransaction.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,14 +522,14 @@ static RPCHelpMan decodescript()
522522
if (can_wrap_P2WSH) {
523523
UniValue sr(UniValue::VOBJ);
524524
CScript segwitScr;
525-
FillableSigningProvider provider;
525+
FlatSigningProvider provider;
526526
if (which_type == TxoutType::PUBKEY) {
527527
segwitScr = GetScriptForDestination(WitnessV0KeyHash(Hash160(solutions_data[0])));
528528
} else if (which_type == TxoutType::PUBKEYHASH) {
529529
segwitScr = GetScriptForDestination(WitnessV0KeyHash(uint160{solutions_data[0]}));
530530
} else {
531531
// Scripts that are not fit for P2WPKH are encoded as P2WSH.
532-
provider.AddCScript(script);
532+
provider.scripts[CScriptID(script)] = script;
533533
segwitScr = GetScriptForDestination(WitnessV0ScriptHash(script));
534534
}
535535
ScriptToUniv(segwitScr, /*out=*/sr, /*include_hex=*/true, /*include_address=*/true, /*provider=*/&provider);

0 commit comments

Comments
 (0)