dcrwallet icon indicating copy to clipboard operation
dcrwallet copied to clipboard

Do not autogenerate voting address for non-voting wallets

Open jrick opened this issue 7 years ago • 2 comments

If a wallet is not in voting mode, all RPCs to purchase tickets should error when not either provided an explicit voting address to use, or the wallet is not configured to create voting addresses from an address/xpub set in the config.

This change is being prompted by the fact that SPV wallets will not vote, so they should not generate one of their own addresses as a voting address without going through additional hoops.

jrick avatar Jun 28 '18 15:06 jrick

Can I get this one?

vctt94 avatar Jul 19 '18 18:07 vctt94

@jrick I think this wasn't taken yet so I've made this enhancement inside #1137 PR as part of voting xpub account implementation with condition

if !w.VotingEnabled() && w.TicketAddress() == nil && !w.VotingAccountEnabled() {
		// Throw error if non-voting wallet has no voting address or voting account configured
		return nil, rpcErrorf(dcrjson.ErrRPCInvalidParameter, "non-voting wallet must have " +
			"configured voting address or voting account")
	}

kLkA avatar Oct 27 '18 16:10 kLkA