You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// disable some items (like Copy Transaction ID, lock, unlock) for tree roots in context menu
177
-
if(item->data(COLUMN_ADDRESS, TxHashRole).toString().length() == 64) // transaction hash is 64 characters (this means it is a child node, so it is not a parent node in tree mode)
178
-
{
177
+
auto txid{Txid::FromHex(item->data(COLUMN_ADDRESS, TxHashRole).toString().toStdString())};
178
+
if (txid) { // a valid txid means this is a child node, and not a parent node in tree mode
if (model->wallet().isLockedCoin(COutPoint(TxidFromString(item->data(COLUMN_ADDRESS, TxHashRole).toString().toStdString()), item->data(COLUMN_ADDRESS, VOutRole).toUInt())))
181
-
{
180
+
if (model->wallet().isLockedCoin(COutPoint(*txid, item->data(COLUMN_ADDRESS, VOutRole).toUInt()))) {
182
181
lockAction->setEnabled(false);
183
182
unlockAction->setEnabled(true);
184
-
}
185
-
else
186
-
{
183
+
} else {
187
184
lockAction->setEnabled(true);
188
185
unlockAction->setEnabled(false);
189
186
}
190
-
}
191
-
else// this means click on parent node in tree mode -> disable all
192
-
{
187
+
} else { // this means click on parent node in tree mode -> disable all
voidCoinControlDialog::viewItemChanged(QTreeWidgetItem* item, int column)
342
337
{
343
-
if (column == COLUMN_CHECKBOX && item->data(COLUMN_ADDRESS, TxHashRole).toString().length() == 64) // transaction hash is 64 characters (this means it is a child node, so it is not a parent node in tree mode)
0 commit comments