You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When DecodeRawTransaction is called, the Addresses property of a Vout.ScriptPubKey property is not initialized and is always null.
Upon investigation, it looks like the root cause it that Bitcoin Core RPC is returning a single address, not a collection of addresses, therefore, the de-serialization does not initialize Addresses property.
It can be illustrated by using bitcoin-cli:
One way of fixing this issue would be to change ScriptPubKey definition to this:
public class ScriptPubKey
{
public string Asm { get; set; }
public string Hex { get; set; }
public int ReqSigs { get; set; }
public string Type { get; set; }
public string Address { get; set; }
}
I don't know whether Bitcoin RPC used to return a list of addresses at some point, so List<string> Addresses was being properly populated, or whether this was always broken. If it's the latter, then it can be argued that the concern about backwards compatibility is small or even virtually non-existent.
As a side note not related to this issue, but related to general completeness of the library, "Desc" property, which is returned by BItcoin RPC, is currently missing from ScriptPubKey.
The text was updated successfully, but these errors were encountered:
When DecodeRawTransaction is called, the Addresses property of a Vout.ScriptPubKey property is not initialized and is always null.
Upon investigation, it looks like the root cause it that Bitcoin Core RPC is returning a single address, not a collection of addresses, therefore, the de-serialization does not initialize Addresses property.
It can be illustrated by using bitcoin-cli:
Command:
Output:
One way of fixing this issue would be to change ScriptPubKey definition to this:
I don't know whether Bitcoin RPC used to return a list of addresses at some point, so
List<string> Addresses
was being properly populated, or whether this was always broken. If it's the latter, then it can be argued that the concern about backwards compatibility is small or even virtually non-existent.As a side note not related to this issue, but related to general completeness of the library, "Desc" property, which is returned by BItcoin RPC, is currently missing from ScriptPubKey.
The text was updated successfully, but these errors were encountered: