3 min de lectura
Bitcoin: scantxoutset timing out
CRYPTOCURRENCY
Error Bitcoin API Outside the Band (OOB): Scantxoutset Timare
Library to interact with Bitcoin Openapi (scantxoutset). However .
Problem: Timing the Connection Outside the Band
When using rpcconnector.rpcignect from scantxoutsetset. However, if the moment of connection takes place before the API Call, the connection will be considered "
Code: Scantxoutset in Connection Timare
**
Let's Take a Look at Your Code .:
Python
Import rpcconnector
rpc_connection = rpcconnector.rpcunect ()
json_req = [
{"Desc": "..."},
here things could go wrong ...
]
In Unfortunately, the Empty Json object is not trigger problems in the «Dict» type incorporated by Python.
Problem: Python’s Dictation Type and Oob Connection
Python’s «Dict» type is designed to store small amousters of data that do not require serialization or desery. In your case, because the json_req
dictionary is empty, it does not trigger problems in the Python Memory aspect. However, when it goes to the rpcconnect () scantxoutsetset, its nature causes the connection time.
Solution: Personalized Json Request
The scantxoutset requirements:
Python
Import json
json_req = {
"Desc": "...",
"Method": "Get",
"Params": {"reqid": 123}
replace with real query parameters ...
}
Using a non-light dictionary, create a personalized json object that meets the need structure. This should prevent the time of oob connection.
Additional Tips
- Make sure you replace
" reqid "
with the actual interrogation parameter (s) required for your application.
*
By modifying