It's senseless to import pubkey pair address.
authorCryptoManiac <balthazar@yandex.ru>
Mon, 7 Mar 2016 01:54:01 +0000 (04:54 +0300)
committerCryptoManiac <balthazar@yandex.ru>
Mon, 7 Mar 2016 01:54:01 +0000 (04:54 +0300)
src/qt/multisigdialog.cpp
src/rpcdump.cpp

index 6013c79..8f9beea 100644 (file)
@@ -312,7 +312,7 @@ void MultisigDialog::on_createTransactionButton_clicked()
                 SendCoinsRecipient recipient = entry->getValue();
                 CBitcoinAddress address(recipient.address.toStdString());
                 CScript scriptPubKey;
-                scriptPubKey.SetDestination(address.Get());
+                scriptPubKey.SetAddress(address);
                 int64_t amount = recipient.amount;
                 CTxOut output(amount, scriptPubKey);
                 transaction.vout.push_back(output);
@@ -657,4 +657,4 @@ void MultisigDialog::keyPressEvent(QKeyEvent *event)
         close();
     }
 #endif
-}
\ No newline at end of file
+}
index 6e72688..1499ace 100644 (file)
@@ -101,13 +101,14 @@ Value importaddress(const Array& params, bool fHelp)
     CScript script;
     CBitcoinAddress address(params[0].get_str());
     if (address.IsValid()) {
-        script.SetDestination(address.Get());
+        if (address.IsPair())
+            throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "It's senseless to import pubkey pair address.");
+        script.SetAddress(address);
     } else if (IsHex(params[0].get_str())) {
         std::vector<unsigned char> data(ParseHex(params[0].get_str()));
         script = CScript(data.begin(), data.end());
-    } else {
+    } else
         throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Novacoin address or script");
-    }
 
     string strLabel = "";
     if (params.size() > 1)
@@ -161,13 +162,14 @@ Value removeaddress(const Array& params, bool fHelp)
 
     CBitcoinAddress address(params[0].get_str());
     if (address.IsValid()) {
-        script.SetDestination(address.Get());
+        if (address.IsPair())
+            throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Pubkey pair addresses aren't supported.");
+        script.SetAddress(address);
     } else if (IsHex(params[0].get_str())) {
         std::vector<unsigned char> data(ParseHex(params[0].get_str()));
         script = CScript(data.begin(), data.end());
-    } else {
+    } else
         throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Bitcoin address or script");
-    }
 
     if (::IsMine(*pwalletMain, script) == MINE_SPENDABLE)
         throw JSONRPCError(RPC_WALLET_ERROR, "The wallet contains the private key for this address or script - can't remove it");