rpcserver: avoid nested decodescript p2sh addrs
This commit is contained in:
parent
e7caccc866
commit
403aaf5cf3
3 changed files with 5 additions and 3 deletions
|
@ -56,7 +56,7 @@ type DecodeScriptResult struct {
|
||||||
ReqSigs int32 `json:"reqSigs,omitempty"`
|
ReqSigs int32 `json:"reqSigs,omitempty"`
|
||||||
Type string `json:"type"`
|
Type string `json:"type"`
|
||||||
Addresses []string `json:"addresses,omitempty"`
|
Addresses []string `json:"addresses,omitempty"`
|
||||||
P2sh string `json:"p2sh"`
|
P2sh string `json:"p2sh,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetAddedNodeInfoResultAddr models the data of the addresses portion of the
|
// GetAddedNodeInfoResultAddr models the data of the addresses portion of the
|
||||||
|
|
|
@ -833,7 +833,9 @@ func handleDecodeScript(s *rpcServer, cmd interface{}, closeChan <-chan struct{}
|
||||||
ReqSigs: int32(reqSigs),
|
ReqSigs: int32(reqSigs),
|
||||||
Type: scriptClass.String(),
|
Type: scriptClass.String(),
|
||||||
Addresses: addresses,
|
Addresses: addresses,
|
||||||
P2sh: p2sh.EncodeAddress(),
|
}
|
||||||
|
if scriptClass != txscript.ScriptHashTy {
|
||||||
|
reply.P2sh = p2sh.EncodeAddress()
|
||||||
}
|
}
|
||||||
return reply, nil
|
return reply, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,7 +106,7 @@ var helpDescsEnUS = map[string]string{
|
||||||
"decodescriptresult-reqSigs": "The number of required signatures",
|
"decodescriptresult-reqSigs": "The number of required signatures",
|
||||||
"decodescriptresult-type": "The type of the script (e.g. 'pubkeyhash')",
|
"decodescriptresult-type": "The type of the script (e.g. 'pubkeyhash')",
|
||||||
"decodescriptresult-addresses": "The bitcoin addresses associated with this script",
|
"decodescriptresult-addresses": "The bitcoin addresses associated with this script",
|
||||||
"decodescriptresult-p2sh": "The script hash for use in pay-to-script-hash transactions",
|
"decodescriptresult-p2sh": "The script hash for use in pay-to-script-hash transactions (only present if the provided redeem script is not already a pay-to-script-hash script)",
|
||||||
|
|
||||||
// DecodeScriptCmd help.
|
// DecodeScriptCmd help.
|
||||||
"decodescript--synopsis": "Returns a JSON object with information about the provided hex-encoded script.",
|
"decodescript--synopsis": "Returns a JSON object with information about the provided hex-encoded script.",
|
||||||
|
|
Loading…
Reference in a new issue