mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 07:04:22 +01:00
pyln-proto: shorten ShortChannelId.from_str()
This commit is contained in:
committed by
Rusty Russell
parent
5787e18e69
commit
f4b8a401cd
@@ -62,9 +62,7 @@ class ShortChannelId(object):
|
||||
|
||||
@classmethod
|
||||
def from_str(self, s):
|
||||
block, txnum, outnum = s.split('x')
|
||||
return ShortChannelId(block=int(block), txnum=int(txnum),
|
||||
outnum=int(outnum))
|
||||
return ShortChannelId(*map(int, s.split('x')))
|
||||
|
||||
def to_int(self):
|
||||
return self.block << 40 | self.txnum << 16 | self.outnum
|
||||
|
||||
Reference in New Issue
Block a user