Fix undefined streamNumber bug

This commit is contained in:
Mahendra Garg 2018-04-10 12:44:32 +05:30
parent 62e80e9ca7
commit 6bce912a81
No known key found for this signature in database
GPG Key ID: A672D8FAAEE398B3

View File

@ -12,14 +12,16 @@ if __name__ == "__main__":
import sys
sys.exit(0)
from SimpleXMLRPCServer import SimpleXMLRPCRequestHandler, SimpleXMLRPCServer
import base64
from SimpleXMLRPCServer import SimpleXMLRPCRequestHandler, SimpleXMLRPCServer
import json
from binascii import hexlify, unhexlify
import shared
import time
from addresses import decodeAddress,addBMIfNotPresent,decodeVarint,calculateInventoryHash,varintDecodeError
from addresses import (decodeAddress, addBMIfNotPresent, decodeVarint,
calculateInventoryHash, varintDecodeError)
from bmconfigparser import BMConfigParser
import defaults
import helper_inbox
@ -27,7 +29,6 @@ import helper_sent
import hashlib
import state
from pyelliptic.openssl import OpenSSL
import queues
import shutdown
from struct import pack
@ -742,6 +743,7 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
fromAddress, 'enabled')
except:
raise APIError(13, 'could not find your fromAddress in the keys.dat file.')
streamNumber = decodeAddress(fromAddress)[2]
ackdata = genAckPayload(streamNumber, 0)
toAddress = '[Broadcast subscribers]'
ripe = ''
@ -1066,5 +1068,3 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
except Exception as e:
logger.exception(e)
return "API Error 0021: Unexpected API Failure - %s" % str(e)