Wie kann ich den folgenden einzeiligen Code verstehen?One-Liner - wie zu verstehen?
vins = {(vin['txid'], vin['vout']) for tx in raw_transactions
for vin in tx['vin'] if 'coinbase' not in vin}
Update 1
Ich teste die folgenden.
vins = []
for tx in raw_transactions:
for vin in tx['vin']:
if 'coinbase' not in vin:
vins.append(vin['txid'], vin['vout'])
aktualisieren 2
Dies ist raw_transactions.
[
{
'txid':'6a31558eadfd4d71316d1f074794716a660d3ca431ac0fa939daf4a971c3edde',
'vin':[
{
'vout':1,
'txid':'3579a3219c071afccddc0f2ac725ad844f5f16f25b253109df6996e824ef9c59'
}
],
'vout':[
{
'value':0.02159592,
'n':0
},
{
'value':0.007462,
'n':1
}
]
},
{
'txid':'92719026074f1e4ff3ea51b49da1a60b31ddda82456b24d70590276a5465687d',
'vin':[
{
'vout':0,
'txid':'6a31558eadfd4d71316d1f074794716a660d3ca431ac0fa939daf4a971c3edde',
}
],
'vout':[
{
'value':0.00226,
'n':0
},
{
'value':0.01481592,
'n':1
}
]
}
]
Was ist 'raw_transactions'? –
@martineau Es ist ein Satzverständnis. – chepner
@chepner: Richtig ... albern mich. Vielen Dank! – martineau