PyBitmessage icon indicating copy to clipboard operation
PyBitmessage copied to clipboard

bitmessagecli crashes when trying to send and you have no own addresses

Open Musickiller opened this issue 10 years ago • 2 comments

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.

Musickiller avatar Jul 13 '16 18:07 Musickiller

Woops... I have not generated an address. I guess you should add some check for that. =)

Musickiller avatar Jul 13 '16 19:07 Musickiller

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 😃

Lvl4Sword avatar Jun 26 '17 22:06 Lvl4Sword