-
Notifications
You must be signed in to change notification settings - Fork 71
Description
By the node version 2.0.7-10 we added the possibility to add an OP code with an Hex encoded string in the transactions that also give an unexpected output format if it is used. This unexpected output format is OP_RETURN _<HEX-STRING>_ .
This was added in the Raw Transaction class:
bitcoinz/src/rpc/rawtransaction.cpp
Line 591 in 977cdc0
| if (name_ == "data") { |
An example of the Raw DATA can be found in this transaction :
https://explorer.btcz.app/tx/b8b29ff7f76e40d01990fad1a8d51d830a66c9f533c3b1768f78fcaf26888ef4
Now, when the Insight option is activated, the node try to find the spent index information about this OP_RETURN code that are not existing as the spent amount is zero (0). And this trigger an error in the debug.log file for each Raw DATA.
Error in the log file for Insight : ERROR: Unable to get spent index information
Triggered here:
Line 1641 in 977cdc0
| return error("Unable to get spent index information"); |
Also a similar error happen in the wallet functions.
Error for the Wallet functions : CWalletTx::GetAmounts: Unknown transaction type found, txid <The_TX_ID>
Triggered here:
bitcoinz/src/wallet/wallet.cpp
Line 2485 in 977cdc0
| LogPrintf("CWalletTx::GetAmounts: Unknown transaction type found, txid %s\n", |
After some time, the log is flooded by this badly returned error information's !
The solution is to check if the output is encoded as usually, with an OP_DUP OP_HASH160 scriptPubKey, or with an Raw DATA field with OP_RETURN . This should be done before calling the function that trigger the error. A check could also be done just before the error is triggered but I guess this will probably have an affect on the performance.