PyBitmessage
PyBitmessage copied to clipboard
bitmessagecli crashes when trying to send and you have no own addresses
python2 bitmessagecli.py send M BM-[some-address] //error
Would you like to send a (M)essage or (B)roadcast?
> M
What is the To Address?
> BM-[some-address]
Using the only address in the addressbook to send from.
Traceback (most recent call last):
File "/data/data/com.termux/files/home/PyBitmessage/src/bitmessagecli.py", line 1778, in <module>
main()
File "/data/data/com.termux/files/home/PyBitmessage/src/bitmessagecli.py", line 1773, in main
UI((raw_input('>').lower()).replace(" ", ""))
File "/data/data/com.termux/files/home/PyBitmessage/src/bitmessagecli.py", line 1348, in UI
main()
File "/data/data/com.termux/files/home/PyBitmessage/src/bitmessagecli.py", line 1773, in main
UI((raw_input('>').lower()).replace(" ", ""))
File "/data/data/com.termux/files/home/PyBitmessage/src/bitmessagecli.py", line 1492, in UI
sendMsg(null,null,null,null)
File "/data/data/com.termux/files/home/PyBitmessage/src/bitmessagecli.py", line 807, in sendMsg
fromAddress = jsonAddresses['addresses'][0]['address']
IndexError: list index out of range
the same with broadcasts.
Woops... I have not generated an address. I guess you should add some check for that. =)
This is fixed in https://github.com/Lvl4Sword/PyBitmessage-CLI/blob/master/bitmessagecli.py My CLI has very minor bugs, but should be production ready.
Protip: This CLI is designed to replace the current one. So if you get an OSError, you didn't replace it 😃