novitski / bitcoinj

Automatically exported from code.google.com/p/bitcoinj
Apache License 2.0
0 stars 0 forks source link

Are these real: Transaction had no inputs or no outputs. #467

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

I regularly see these errors in the logs:
2013-10-01/21:01:42.167/UTC [New I/O worker #1] WARN  Peer$PeerHandler[251] 
[192.30.32.57]:8333 -
com.google.bitcoin.core.VerificationException: Transaction had no inputs or no 
outputs.
        at com.google.bitcoin.core.Transaction.verify(Transaction.java:1146)
        at com.google.bitcoin.core.Peer.processTransaction(Peer.java:498)
        at com.google.bitcoin.core.Peer.processMessage(Peer.java:303)
        at com.google.bitcoin.core.Peer.access$400(Peer.java:54)
        at com.google.bitcoin.core.Peer$PeerHandler.messageReceived(Peer.java:264)
        at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296)
        at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462)
        at org.jboss.netty.handler.codec.replay.ReplayingDecoder.callDecode(ReplayingDecoder.java:536)
        at org.jboss.netty.handler.codec.replay.ReplayingDecoder.messageReceived(ReplayingDecoder.java:435)
        at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)
        at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)
        at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)
        at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:107)
        at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:312)
        at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:88)
        at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:679)
2013-10-01/21:01:42.171/UTC [New I/O worker #1] INFO  Peer$PeerHandler[249] 
[192.30.32.57]:8333 - Socket is disconnected

And looking further up in log it looks like a Satoshi client:

2013-10-01/20:56:59.139/UTC [New I/O worker #1] INFO  TCPNetworkConnection[147] 
Connected to 192.30.32.57: version=70001, subVer='/Satoshi:0.8.1/', 
services=0x1, time=Tue Oct 01 20:56:57 UTC 2013, blocks=261154
2013-10-01/20:56:59.140/UTC [New I/O worker #1] INFO  PeerGroup[839] 
[192.30.32.57]:8333: New peer

So seems unlikely we are actually being sent these transactions. More likely a 
bug in the parsing or partial messages?
Some more debug info when get bad Tx's would be useful. E.g. log the bytes? 

Original issue reported on code.google.com by murexcon...@googlemail.com on 1 Oct 2013 at 9:07

GoogleCodeExporter commented 9 years ago
No, the message is correct. If you check a debug.log from a regular node you'll 
see similar errors on the C++ side. There's something out there on the network 
that is creating invalid empty transactions and has been for a long time. If I 
recall correctly it was possible to make a node announce such a broken tx by 
using the raw transaction JSON-RPCs in old versions or something like that.

The giant stack trace is kind of ugly and pointless. We might want to tidy up 
the logging a bit so only the relevant part of the stack gets printed. But 
bitcoinj is doing the right thhing.

Original comment by hearn@google.com on 2 Oct 2013 at 9:11