Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Litecoin RPC GetBlock() throws System.FormatException: Unknown Transaction optional data for some blocks #1108

Closed
rvnlord opened this issue Jun 21, 2022 · 4 comments

Comments

@rvnlord
Copy link

rvnlord commented Jun 21, 2022

There is a bug with Litecoin serializer which will throw System.FormatException: Unknown Transaction optional data for some transactions in some blocks. To reproduce run:

var customHash = (await Rpc.GetBlockHeaderAsync(2284382)).GetHash();
var block = await Rpc.GetBlockAsync(customHash);

or

var resp = await Rpc.SendCommandAsync(RPCOperations.getblock, CancellationToken.None, customHash, false);
var block2 = Network.Main.Consensus.ConsensusFactory.CreateBlock();
var s = new BitcoinStream(new MemoryStream(Encoders.Hex.DecodeData(resp.ResultString)), false) { ConsensusFactory = Network.Main.Consensus.ConsensusFactory };
block2.ReadWrite(s);

Example transaction that causes the problem can be found in block 2284382 with 3bed06209f382e20f7b4eb1724366835874769763744d3cc429182422c8e7950 hash.

@NicolasDorier
Copy link
Collaborator

@rvnlord can you copy the transaction's hex here?

@rvnlord
Copy link
Author

rvnlord commented Jun 22, 2022

02000000000801d0e493224859b9210af6f88791365b2d40fe45099feeff1474bbc69c5e9200060000000000ffffffff0112bab955d700000022582073a2485a7c127ffca4e0c39484a5145307ea86771f57b6a87be195a3813e3f2e0000000000

@twilightrus
Copy link

twilightrus commented Jul 5, 2022

+1 @NicolasDorier

@NicolasDorier
Copy link
Collaborator

Should be fixed #1125 was caused by a hardfork of ltc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants