forked from LBRYCommunity/lbry-sdk
claim_id is hexlified before saving to sqlite
This commit is contained in:
parent
0f90dee224
commit
a1b4c9acd6
1 changed files with 3 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
||||||
import sqlite3
|
import sqlite3
|
||||||
|
from binascii import hexlify
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
from torba.basedatabase import BaseDatabase
|
from torba.basedatabase import BaseDatabase
|
||||||
from .certificate import Certificate
|
from .certificate import Certificate
|
||||||
|
@ -41,9 +42,9 @@ class WalletDatabase(BaseDatabase):
|
||||||
if txo.script.is_claim_involved:
|
if txo.script.is_claim_involved:
|
||||||
row['claim_name'] = txo.script.values['claim_name']
|
row['claim_name'] = txo.script.values['claim_name']
|
||||||
if txo.script.is_update_claim or txo.script.is_support_claim:
|
if txo.script.is_update_claim or txo.script.is_support_claim:
|
||||||
row['claim_id'] = txo.script.values['claim_id']
|
row['claim_id'] = hexlify(txo.script.values['claim_id'][::-1])
|
||||||
elif txo.script.is_claim_name:
|
elif txo.script.is_claim_name:
|
||||||
row['claim_id'] = tx.get_claim_id(txo.position)
|
row['claim_id'] = hexlify(tx.get_claim_id(txo.position)[::-1])
|
||||||
return row
|
return row
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
|
|
Loading…
Reference in a new issue