Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions DashWallet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1917,6 +1917,8 @@
D19A81C4F6103AC513D737AA /* UsernameRequestStatusScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED4CB35186918CCBD2FFC49F /* UsernameRequestStatusScreen.swift */; };
63C3BBEF4EE77A6F02144B2D /* BulkVoteSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3E5E523355F3EEC5CDEB00A /* BulkVoteSheet.swift */; };
25B84141680B6A9F225C995C /* BulkVoteSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3E5E523355F3EEC5CDEB00A /* BulkVoteSheet.swift */; };
7062FCF792F292D84A0B819B /* VoteHistoryDAO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AFB72236D79932EAE7A38E2 /* VoteHistoryDAO.swift */; };
553696A24F315D361BC86231 /* VoteHistoryDAO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AFB72236D79932EAE7A38E2 /* VoteHistoryDAO.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -3640,6 +3642,7 @@
FF2C19E8480582798A0155E4 /* CastVoteSheet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CastVoteSheet.swift; sourceTree = "<group>"; };
ED4CB35186918CCBD2FFC49F /* UsernameRequestStatusScreen.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UsernameRequestStatusScreen.swift; sourceTree = "<group>"; };
C3E5E523355F3EEC5CDEB00A /* BulkVoteSheet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = BulkVoteSheet.swift; sourceTree = "<group>"; };
0AFB72236D79932EAE7A38E2 /* VoteHistoryDAO.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = VoteHistoryDAO.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFileSystemSynchronizedRootGroup section */
Expand Down Expand Up @@ -4522,6 +4525,7 @@
2A44313D22CF632F009BAF7F /* Models */ = {
isa = PBXGroup;
children = (
515C73491D3755649EB0709D /* Voting */,
AA0002192BA0F58E00A1B309 /* Maya */,
AA0010002CA0B10001A0B100 /* SwapKit */,
AA0020012FA0000000000001 /* Swap */,
Expand Down Expand Up @@ -8589,6 +8593,14 @@
path = Voting;
sourceTree = "<group>";
};
515C73491D3755649EB0709D /* Voting */ = {
isa = PBXGroup;
children = (
0AFB72236D79932EAE7A38E2 /* VoteHistoryDAO.swift */,
);
path = Voting;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -9389,6 +9401,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
553696A24F315D361BC86231 /* VoteHistoryDAO.swift in Sources */,
25B84141680B6A9F225C995C /* BulkVoteSheet.swift in Sources */,
D19A81C4F6103AC513D737AA /* UsernameRequestStatusScreen.swift in Sources */,
6181C570B638E07D8B369CDB /* VotingViewModel.swift in Sources */,
Expand Down Expand Up @@ -10257,6 +10270,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
7062FCF792F292D84A0B819B /* VoteHistoryDAO.swift in Sources */,
63C3BBEF4EE77A6F02144B2D /* BulkVoteSheet.swift in Sources */,
E503EDEA94E656CAE70E5A11 /* UsernameRequestStatusScreen.swift in Sources */,
1FED991A9D2D236582CE3C99 /* CastVoteSheet.swift in Sources */,
Expand Down
4 changes: 4 additions & 0 deletions DashWallet/Sources/Application/App.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ final class App {
func cleanUp() {
TransactionMetadataDAOImpl.shared.deleteAll()
AddressUserInfoDAOImpl.shared.deleteAll()
#if DASHPAY
// Which of your masternodes voted on what is wallet-scoped history.
VoteHistoryDAOImpl.shared.deleteAll()
#endif

_fiatCurrency = nil
UserDefaults.standard.removeObject(forKey: kFiatCurrencyCodeKey)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
-- One row per (masternode, contest, network): the vote this device last cast
-- with that node on that contest.
--
-- Needed so the voting UI can say how many of your nodes have already voted on
-- a contest, and so "vote with one node at a time" knows which node is next.
-- Platform can be asked who voted, but only per contender and only by voter
-- identity, so answering "which of MY nodes voted here" from the network costs
-- a query per contender and still cannot see abstain/lock voters.
--
-- `proTxHash` is stored in raw wire byte order, matching PlatformMasternode.
-- `castAt` is milliseconds since epoch.
CREATE TABLE masternode_vote_history (

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Use a non-future migration timestamp.

The filename 20260808030000_add_masternode_vote_history.sql encodes August 8, 2026. The review date is August 7, 2026. A migration created later on August 7 can sort before this migration in a timestamp-ordered runner. Rename this file with its actual creation timestamp before merge.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@DashWallet/Sources/Infrastructure/Database/Migrations.bundle/20260808030000_add_masternode_vote_history.sql`
at line 12, Rename the migration file containing the masternode_vote_history
CREATE TABLE statement to use its actual creation timestamp on or before August
7, 2026, rather than the future 20260808030000 timestamp. Preserve the migration
name suffix and ensure the updated timestamp maintains correct ordering with
other migrations.

Source: Coding guidelines

proTxHash BLOB NOT NULL,
normalizedLabel TEXT NOT NULL,
network TEXT NOT NULL,
choice TEXT NOT NULL,
contenderIdentityId TEXT,
castAt INTEGER NOT NULL,
PRIMARY KEY (proTxHash, normalizedLabel, network)
);

CREATE INDEX idx_masternode_vote_history_contest
ON masternode_vote_history (normalizedLabel, network);
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,14 @@ final class MasternodeVoteCaster {
subsystem: "org.dashfoundation.dash",
category: "swift-sdk-migration.voting")

private static let history: VoteHistoryDAO = VoteHistoryDAOImpl.shared

/// Vote history is per Platform network — a testnet contest and a mainnet
/// one can share a label, and their counts must never merge.
static var networkKey: String {
WalletEnvironment.network == .mainnet ? "mainnet" : "testnet"
}

private let registry: MasternodeVoterRegistry
private let contests: ContestedNamesService

Expand Down Expand Up @@ -222,6 +230,15 @@ final class MasternodeVoteCaster {
proTxHash: node.proTxHash,
votingPrivateKey: votingKey)
outcomes.append(VoteOutcome(node: node, failure: nil))
// Recorded only on success, so the count the UI shows is
// votes Platform accepted — not votes attempted.
await Self.history.record(
CastVoteRecord(
proTxHash: node.proTxHash,
normalizedLabel: normalizedLabel,
choice: choice,
castAt: Date()),
network: Self.networkKey)
Comment on lines +233 to +241

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Expose vote-history database failures to both callers.

The DAO swallows SQLite failures, so callers cannot guarantee that accepted votes are persisted or that wallet cleanup removed old history.

  • DashWallet/Sources/Infrastructure/SwiftDashSDK/Voting/MasternodeVoteCaster.swift#L233-L241: return or throw the record result and provide retryable local-history handling after a successful Platform vote.
  • DashWallet/Sources/Application/App.swift#L106-L109: return or throw the delete result and prevent cleanup from completing silently when deletion fails.
📍 Affects 2 files
  • DashWallet/Sources/Infrastructure/SwiftDashSDK/Voting/MasternodeVoteCaster.swift#L233-L241 (this comment)
  • DashWallet/Sources/Application/App.swift#L106-L109
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@DashWallet/Sources/Infrastructure/SwiftDashSDK/Voting/MasternodeVoteCaster.swift`
around lines 233 - 241, Update MasternodeVoteCaster’s successful Platform-vote
path to propagate the history record result or throw on failure, while retaining
retryable local-history handling after the vote succeeds; update App.swift
cleanup at lines 106-109 to propagate or throw the delete result so failed
history deletion cannot complete silently.

Self.logger.info(
"🗳️ VOTING :: cast \(choice.logDescription, privacy: .public) on \(normalizedLabel, privacy: .public) with \(node.displayName, privacy: .public)")
} catch {
Expand Down
179 changes: 179 additions & 0 deletions DashWallet/Sources/Models/Voting/VoteHistoryDAO.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
//
// VoteHistoryDAO.swift
// DashWallet
//
// Copyright © 2026 Dash Core Group. All rights reserved.
//
// Licensed under the MIT License (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://opensource.org/licenses/MIT
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

import Foundation
@preconcurrency import SQLite

// MARK: - CastVoteRecord

/// A vote this device cast with one of the wallet's masternodes.
///
/// Records what *we* did, not what Platform holds. Platform is the authority on
/// tallies, but it cannot cheaply answer "which of my nodes already voted
/// here": `getContestedResourceVotersForIdentity` is per contender, keyed by
/// voter identity, and cannot see abstain or lock voters at all. Voting one
/// node at a time needs that answer on every tap, so it is kept locally.
struct CastVoteRecord: Hashable {
/// Raw wire byte order, matching `PlatformMasternode.proTxHash`.
let proTxHash: Data
let normalizedLabel: String
let choice: VoteChoice
let castAt: Date
}

// MARK: - VoteHistoryDAO

protocol VoteHistoryDAO {
/// Upsert — a node re-voting on the same contest replaces its own row,
/// mirroring Platform, where a masternode has one live vote per poll.
func record(_ record: CastVoteRecord, network: String) async
/// Votes this device cast on one contest, newest first.
func votes(forContest normalizedLabel: String, network: String) async -> [CastVoteRecord]
/// Every contest this device has voted on, mapped to its vote count.
/// One query for the whole list screen rather than one per row.
func voteCountsByContest(network: String) async -> [String: Int]
func deleteAll()
}

// MARK: - VoteHistoryDAOImpl

actor VoteHistoryDAOImpl: VoteHistoryDAO {
static let shared = VoteHistoryDAOImpl()

private nonisolated var db: Connection { DatabaseConnection.shared.db }

private init() {}

func record(_ record: CastVoteRecord, network: String) async {
let query = """
INSERT INTO masternode_vote_history
(proTxHash, normalizedLabel, network, choice, contenderIdentityId, castAt)
VALUES (?, ?, ?, ?, ?, ?)
ON CONFLICT (proTxHash, normalizedLabel, network) DO UPDATE SET
choice = excluded.choice,
contenderIdentityId = excluded.contenderIdentityId,
castAt = excluded.castAt
"""
let bindings: [Binding?] = [
Blob(bytes: [UInt8](record.proTxHash)),
record.normalizedLabel,
network,
record.choice.storageKind,
record.choice.storageContenderId,
Int64(record.castAt.timeIntervalSince1970 * 1000),
]

do {
try db.run(query, bindings)
} catch {
DWLogger.log("VoteHistoryDAO: record failed: \(error)")
}
Comment on lines +82 to +86

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Do not hide vote-history write failures.

record logs the database error and returns normally. MasternodeVoteCaster.castAuthenticated records the vote after Platform accepts it. If this write fails, the next refresh or app launch reoffers a node that already voted.

Make record return or throw the persistence failure. The caller must retry the durable write or report a recoverable persistence failure.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@DashWallet/Sources/Models/Voting/VoteHistoryDAO.swift` around lines 82 - 86,
Update VoteHistoryDAO.record to propagate database write failures instead of
logging and returning normally. Make MasternodeVoteCaster.castAuthenticated
handle the propagated failure by retrying the durable vote-history write or
reporting a recoverable persistence error after Platform accepts the vote.

}

func votes(forContest normalizedLabel: String, network: String) async -> [CastVoteRecord] {
let query = """
SELECT proTxHash, normalizedLabel, choice, contenderIdentityId, castAt
FROM masternode_vote_history
WHERE normalizedLabel = ? AND network = ?
ORDER BY castAt DESC
"""
do {
// `prepare` yields positional `[Binding?]` rows, which is what a
// hand-written SELECT needs; `Row` subscripting is for typed
// `Expression` columns.
return try db.prepare(query, [normalizedLabel, network]).compactMap { row -> CastVoteRecord? in
guard let blob = row[0] as? Blob,
let label = row[1] as? String,
let kind = row[2] as? String,
let castAt = row[4] as? Int64,
let choice = VoteChoice(storageKind: kind, contenderId: row[3] as? String)
else { return nil }
return CastVoteRecord(
proTxHash: Data(blob.bytes),
normalizedLabel: label,
choice: choice,
castAt: Date(timeIntervalSince1970: Double(castAt) / 1000))
}
} catch {
DWLogger.log("VoteHistoryDAO: votes(forContest:) failed: \(error)")
return []
}
}

func voteCountsByContest(network: String) async -> [String: Int] {
let query = """
SELECT normalizedLabel, COUNT(*)
FROM masternode_vote_history
WHERE network = ?
GROUP BY normalizedLabel
"""
do {
var counts: [String: Int] = [:]
for row in try db.prepare(query, [network]) {
guard let label = row[0] as? String, let count = row[1] as? Int64 else { continue }
counts[label] = Int(count)
}
return counts
} catch {
DWLogger.log("VoteHistoryDAO: voteCountsByContest failed: \(error)")
return [:]
}
}

nonisolated func deleteAll() {
do {
try db.run("DELETE FROM masternode_vote_history")
Comment on lines +139 to +141

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Locate wallet-wipe deletion callers and DAO access sites.
ast-grep outline DashWallet/Sources/Models/Voting/VoteHistoryDAO.swift --items all --view expanded
rg -n -C 6 --glob '*.swift' 'VoteHistoryDAOImpl\.shared|VoteHistoryDAO|\.deleteAll\s*\(' DashWallet/Sources

Repository: dashpay/dashwallet-ios

Length of output: 12952


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- App.cleanUp context and callers ---'
sed -n '70,130p' DashWallet/Sources/Application/App.swift
rg -n -C 8 --glob '*.swift' 'cleanUp\s*\(|\.cleanUp\s*\(' DashWallet/Sources

printf '%s\n' '--- Vote caster write path ---'
sed -n '100,260p' DashWallet/Sources/Infrastructure/SwiftDashSDK/Voting/MasternodeVoteCaster.swift
rg -n -C 8 --glob '*.swift' 'history\.record|record\s*\(.*CastVoteRecord|castVote|cast\(' DashWallet/Sources/Infrastructure/SwiftDashSDK/Voting DashWallet/Sources/UI/DashPay/Voting

printf '%s\n' '--- DAO and database connection definitions ---'
sed -n '1,155p' DashWallet/Sources/Models/Voting/VoteHistoryDAO.swift
rg -n -C 8 --glob '*.swift' 'class DatabaseConnection|struct DatabaseConnection|static let shared.*DatabaseConnection|Connection\(' DashWallet/Sources

Repository: dashpay/dashwallet-ios

Length of output: 43142


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- Wallet wiper structure and call sites ---'
ast-grep outline DashWallet/Sources/Infrastructure/SwiftDashSDK/SwiftDashSDKWalletWiper.swift --items all --view expanded
sed -n '1,210p' DashWallet/Sources/Infrastructure/SwiftDashSDK/SwiftDashSDKWalletWiper.swift
rg -n -C 10 --glob '*.swift' 'SwiftDashSDKWalletWiper|wipeWallet|deleteWallet|removeWallet|wallet.*wipe|wipe.*wallet' DashWallet/Sources

printf '%s\n' '--- Vote-cast task and lifecycle coordination ---'
rg -n -C 8 --glob '*.swift' 'MasternodeVoteCaster|VotingViewModel|Task\s*\{|Task\.|cancel\s*\(|isCasting|cleanUp\s*\(' DashWallet/Sources/Infrastructure/SwiftDashSDK DashWallet/Sources/UI/DashPay/Voting DashWallet/Sources/Application

Repository: dashpay/dashwallet-ios

Length of output: 50379


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- SwiftDashSDKWalletWiper.swift ---'
wc -l DashWallet/Sources/Infrastructure/SwiftDashSDK/SwiftDashSDKWalletWiper.swift
sed -n '1,190p' DashWallet/Sources/Infrastructure/SwiftDashSDK/SwiftDashSDKWalletWiper.swift

printf '%s\n' '--- Exact App.cleanUp callers ---'
rg -n -C 12 --glob '*.swift' 'App(\.shared)?\.cleanUp|waitForPendingWipe|deleteWalletFromSDK' DashWallet/Sources/Infrastructure/SwiftDashSDK DashWallet/Sources/Application DashWallet/Sources/UI/Setup DashWallet/Sources/UI/Menu

printf '%s\n' '--- Vote task ownership ---'
rg -n -C 5 --glob '*.swift' 'Task\s*\{|Task\.|isCasting|MasternodeVoteCaster' DashWallet/Sources/UI/DashPay/Voting DashWallet/Sources/Infrastructure/SwiftDashSDK/Voting

Repository: dashpay/dashwallet-ios

Length of output: 50378


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
from pathlib import Path

dao = Path("DashWallet/Sources/Models/Voting/VoteHistoryDAO.swift").read_text()
caster = Path("DashWallet/Sources/Infrastructure/SwiftDashSDK/Voting/MasternodeVoteCaster.swift").read_text()
app = Path("DashWallet/Sources/Application/App.swift").read_text()
wiper = Path("DashWallet/Sources/Infrastructure/SwiftDashSDK/SwiftDashSDKWalletWiper.swift").read_text()
sheet = Path("DashWallet/Sources/UI/DashPay/Voting/CastVoteSheet.swift").read_text()
bulk = Path("DashWallet/Sources/UI/DashPay/Voting/BulkVoteSheet.swift").read_text()

checks = {
    "deleteAll is nonisolated and synchronous": "nonisolated func deleteAll()" in dao,
    "record is async": "func record(_ record: CastVoteRecord, network: String) async" in dao,
    "successful SDK cast precedes record": (
        "try await sdk.castContestedResourceVote(" in caster
        and "await Self.history.record(" in caster
        and caster.index("try await sdk.castContestedResourceVote(")
            < caster.index("await Self.history.record(")
    ),
    "cleanup calls synchronous deleteAll": "VoteHistoryDAOImpl.shared.deleteAll()" in app,
    "cleanup is inside main sync": (
        "DispatchQueue.main.sync {" in wiper
        and wiper.index("DispatchQueue.main.sync {")
            < wiper.index("App.shared.cleanUp()")
    ),
    "single-vote UI starts unretained Task": "Task {" in sheet and "await viewModel.cast(" in sheet,
    "bulk-vote UI starts unretained Task": "Task { await viewModel.castBulk" in bulk,
}

for name, passed in checks.items():
    print(f"{'PASS' if passed else 'FAIL'}: {name}")
if not all(checks.values()):
    raise SystemExit(1)
PY

Repository: dashpay/dashwallet-ios

Length of output: 433


Coordinate wallet-wipe cleanup with vote recording.

A successful vote records history asynchronously after the SDK call returns. Wallet wipe can delete history before record runs.

Make deleteAll() actor-isolated and asynchronous. Await it after active vote tasks finish or cancel.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@DashWallet/Sources/Models/Voting/VoteHistoryDAO.swift` around lines 139 -
141, Update VoteHistoryDAO.deleteAll() to be actor-isolated and async instead of
nonisolated and synchronous. In the wallet-wipe flow, wait for active
vote-recording tasks to finish or cancel them before awaiting deleteAll(),
ensuring no asynchronous record operation can recreate history after deletion.

} catch {
DWLogger.log("VoteHistoryDAO: deleteAll failed: \(error)")
}
}
}

// MARK: - VoteChoice storage

extension VoteChoice {
/// Stored as a discriminator plus an optional id rather than a formatted
/// string, so reading it back is a lookup instead of prefix-parsing.
var storageKind: String {
switch self {
case .towards: return "towards"
case .abstain: return "abstain"
case .lock: return "lock"
}
}

var storageContenderId: String? {
if case .towards(let identityId) = self { return identityId }
return nil
}

init?(storageKind: String, contenderId: String?) {
switch storageKind {
case "towards":
guard let contenderId else { return nil }
self = .towards(identityId: contenderId)
case "abstain":
self = .abstain
case "lock":
self = .lock
default:
return nil
}
}
}
21 changes: 20 additions & 1 deletion DashWallet/Sources/Models/Voting/VotingPrefs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import Foundation

private let kVotingEnabled = "votingEnabledKey"
private let kVoteWithAllNodes = "voteWithAllNodesKey"

// MARK: - VotingPrefs

Expand All @@ -27,7 +28,13 @@ class VotingPrefs {
public static let shared: VotingPrefs = .init()

init() {
UserDefaults.standard.register(defaults: [kVotingEnabled : true])
// Voting one node at a time is the default on purpose: casting every
// node's vote in one action publicly links those masternodes to each
// other, which is a privacy loss the user cannot undo afterwards.
UserDefaults.standard.register(defaults: [
kVotingEnabled: true,
kVoteWithAllNodes: false,
])
}

private var _votingEnabled: Bool? = nil
Expand All @@ -41,4 +48,16 @@ class VotingPrefs {
UserDefaults.standard.set(value, forKey: kVotingEnabled)
}
}

/// `false` (default) casts one masternode's vote per tap; `true` casts
/// with every votable node at once.
///
/// Voting all at once broadcasts several `MasternodeVote` transitions for
/// the same poll in quick succession, which lets an observer group those
/// nodes as one operator. One at a time keeps that correlation the user's
/// choice rather than a side effect of the default.
var voteWithAllNodes: Bool {
get { UserDefaults.standard.bool(forKey: kVoteWithAllNodes) }
set { UserDefaults.standard.set(newValue, forKey: kVoteWithAllNodes) }
}
}
Loading
Loading