MetacoSA / QBitNinja

An Open Source and powerful blockchain API
MIT License
68 stars 42 forks source link

GetTransaction returns null for TestNet transaction #106

Closed AnturGyffrous closed 4 years ago

AnturGyffrous commented 4 years ago

I am using the QBitNinjaClient to try and retrieve transaction id 51cc9a586494462c1da9e1b911a8b552ebe2f43fcf63e6934d1be8015c4e4386 on the TestNet network but receive a null response when calling GetTransaction.

I used Bitcoin testnet3 faucet from coinfaucet.eu to send 0.02828399 bitcoins to my TestNet address tb1qmkyxqpeu2kx06dqxcraesx22sn99stam2psw93, I can see this transaction on testnet.smartbit.com.au, but when I execute the following code the transactionResponse is null so a System.NullReferenceException is thrown with the message "Object reference not set to an instance of an object.":

var client = new QBitNinjaClient(Network.TestNet);
var transactionId = uint256.Parse("51cc9a586494462c1da9e1b911a8b552ebe2f43fcf63e6934d1be8015c4e4386");
var transactionResponse = client.GetTransaction(transactionId).Result;

Console.WriteLine(transactionResponse.TransactionId);

However, when I use a transaction linked to address mzp4No5cmCXjZUpf112B1XWsvWBfws5bbB, i.e. 8e2e588a13da2adb8d2dcc69b8c2c23dda2f60447f03021ec635a5191fa79e36 first seen on Tue, 13 Aug 2019 22:50:54 GMT I do receive details about the transaction:

Transaction Id: 8e2e588a13da2adb8d2dcc69b8c2c23dda2f60447f03021ec635a5191fa79e36
Confirmations: 14662
First Seen: Tue, 13 Aug 2019 22:50:54 GMT

Why is it that I cannot see my more recent transaction? Is this a timing issue, do I just need to wait longer, if so, how much longer?

Thanks in advance for any help you can provide, and apologies if I've done something stupid, or raised this issue in the wrong place.

NicolasDorier commented 4 years ago

Mhh around same time, got reported https://github.com/MetacoSA/QBitNinja/issues/107

NicolasDorier commented 4 years ago

So I found out my indexer had been running 100% of CPU... checking what is goingon.

NicolasDorier commented 4 years ago

So our testnet node does not work anymore. It seems I need to resync it from scratch. tapi will not work for some days...

AnturGyffrous commented 4 years ago

Thanks for the info.

NicolasDorier commented 4 years ago

Closing this, testnet is synched again, reopen it if it does not work.

jole95 commented 4 years ago

I have the same problem like @AnturGyffrous. I still don't know how to fix it. Could you help me guys @NicolasDorier, @AnturGyffrous. I have been struggling for a long time to resolve this, but it is failing.

Thank you, it would mean a lot to me because I'm wasting my time and I must to do it for graduate work.

menavas commented 4 years ago

Hi, I have the same issue, is there a way to manipulate the Testnet node wich NBitcoin is attaching?,

Best Regards

jole95 commented 4 years ago

I am interested too. I'd like to resolve that.

NicolasDorier commented 4 years ago

I am not maintaining the server that well anymore. Please if you can, switch to https://github.com/dgarage/NBXplorer/ this is better as you can host it by yourself more easily that qbitninja, and have a way better API for modern wallet management. It also work in pruned mode.