[BCH]: workaround for Bitcoin ABC's broken 'setlabel' RPC

This commit is contained in:
The MMGen Project 2019-11-29 18:41:36 +00:00
commit bb87b1f996
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2

View file

@ -731,7 +731,9 @@ class TrackingWallet(MMGenObject):
@write_mode
def set_label(self,coinaddr,lbl):
if 'label_api' in g.rpch.caps:
# bitcoin-abc 'setlabel' RPC is broken, so use old 'importaddress' method to set label
# broken behavior: new label is set OK, but old label gets attached to another address
if 'label_api' in g.rpch.caps and g.coin != 'BCH':
return g.rpch.setlabel(coinaddr,lbl,on_fail='return')
else:
# NOTE: this works because importaddress() removes the old account before