diff options
| author | Matt Corallo <[email protected]> | 2011-03-05 15:32:32 +0100 |
|---|---|---|
| committer | Matt Corallo <[email protected]> | 2011-03-05 15:32:32 +0100 |
| commit | 279ab5e62f4e4344061d54b341d8d36af874fb88 (patch) | |
| tree | 988327dbaaa4ed7e01824ae4a3e0c1db0ed94df0 /rpc.cpp | |
| parent | Make send/receive limits bigger (10MB each) (diff) | |
| download | discoin-279ab5e62f4e4344061d54b341d8d36af874fb88.tar.xz discoin-279ab5e62f4e4344061d54b341d8d36af874fb88.zip | |
setaccount should return if an invalid address is provided.
This prevents setaccount from creating new accounts which do not have any addresses.
Diffstat (limited to 'rpc.cpp')
| -rw-r--r-- | rpc.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -381,6 +381,12 @@ Value setaccount(const Array& params, bool fHelp) "Sets the account associated with the given address."); string strAddress = params[0].get_str(); + uint160 hash160; + bool isValid = AddressToHash160(strAddress, hash160); + if (!isValid) + throw runtime_error("provided address is not valid"); + + string strAccount; if (params.size() > 1) strAccount = AccountFromValue(params[1]); |