MetacoSA / QBitNinja

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

Again issue with test indexing #34

Closed cryptodeveloperin closed 6 years ago

cryptodeveloperin commented 6 years ago

Hi Nic,

I have check the nbitcoin and may be some issue with indexing. https://live.blockcypher.com/btc-testnet/tx/10fa6d8fa236e424c073fda72873779507b7d67b14218b6ee1c9032525b0a34d/

This transaction is shows 6+ confirmation but currently when i use following code then it was not retrieve the transaction.

IDestination userUniqueKey = masterPubKey.Derive((uint)9); (this is my wallet index) BalanceSelector balanceSelector = new BalanceSelector(userUniqueKey.ScriptPubKey); BalanceModel transactionHistory;
transactionHistory = client.GetBalance(balanceSelector, true).Result;

Also let me know this issue arise with live environment?

NicolasDorier commented 6 years ago

I am looking around the testnet is correctly sync. So this is likely a different issue.

NicolasDorier commented 6 years ago

This is likely a bug of your code, all scriptPubKey involved show the transaction correctly, one of the example is https://tapi.qbit.ninja/balances/0x76a9144d1c574c397a934c6a55840fe9e9bde2835c510c88ac?unspentOnly=true

james1278 commented 6 years ago

We got proper Transaction history using this code but from today we are getting 0 transaction history for WalletAddress= n3d6Veyd7AsK236YPmuvQezrT8Yhd4DjpF, PubKey = 03360b08fbdf9f7f6c6ed322468b619848ece0a92bcf92bb22ed9cbd0dbbd91587, ScriptPubKey = OP_DUP OP_HASH160 47f60ce80008c4a7e047bdc58ae6431f628d9548 OP_EQUALVERIFY OP_CHECKSIG, BalanceSelector = 0x76a91447f60ce80008c4a7e047bdc58ae6431f628d954888ac,

Code

IDestination userUniqueKey = masterPubKey.Derive((uint)walletAddress.UserAutoId); BalanceSelector balanceSelector = new BalanceSelector(userUniqueKey.ScriptPubKey); BalanceModel transactionHistory;
transactionHistory = client.GetBalance(balanceSelector, true).Result;

this code working last 7 days but today we are are getting some issue so please that can let me know what wrong in our code. we need all unspent transaction for given wallet address.

NicolasDorier commented 6 years ago

I am looking into it thanks.

NicolasDorier commented 6 years ago

mmh, https://tapi.qbit.ninja/balances/n3d6Veyd7AsK236YPmuvQezrT8Yhd4DjpF?unspentOnly=true seems to have history

NicolasDorier commented 6 years ago

The balance match smartbit http://tapi.qbit.ninja/balances/n3d6Veyd7AsK236YPmuvQezrT8Yhd4DjpF/summary vs https://testnet.smartbit.com.au/address/n3d6Veyd7AsK236YPmuvQezrT8Yhd4DjpF

NicolasDorier commented 6 years ago

Ok, so your problem is that the balance selector/scriptPubKey you are giving me do not match the address you provided, check

http://tapi.qbit.ninja/whatisit/n3d6Veyd7AsK236YPmuvQezrT8Yhd4DjpF

I think you are wrong in your derivation somehow.

james1278 commented 6 years ago

Tomorrow i will check again and will send proper detail for key .

cryptodeveloperin commented 6 years ago

i have change some code and now it work perfect. Thanks.