This is a memory-only filter, which must be applied at bitcoind startup.
It might be nice to store this in the wallet, but to judge interest and review the interface, this is a useful first step.
This is a memory-only filter, which must be applied at bitcoind startup.
It might be nice to store this in the wallet, but to judge interest and review the interface, this is a useful first step.
1477+ pwalletMain->UnlockAllCoins();
1478+ return true;
1479+ }
1480+
1481+ if (params[1].type() != array_type)
1482+ throw JSONRPCError(-8, "Invalid parameter 1, not array");
1503+ COutPoint outpt(uint256(txid), nOutput);
1504+
1505+ if (fUnlock)
1506+ pwalletMain->UnlockCoin(outpt);
1507+ else
1508+ pwalletMain->LockCoin(outpt);
@sipa RPC “listunspent” already works on the wallet structure, thus “lockunspent” works with the information found in “listunspent”
Making “lockunspent” work globally, even for ‘sendrawtransactions’ coins not in the wallet is doable, but it creates a disconnect between the dataset manipulated by “listunspent” and the one manipulated by “lockunspent”.
Is that disconnect acceptable?
1485+ BOOST_FOREACH(Value& output, outputs)
1486+ {
1487+ const Object& o = output.get_obj();
1488+
1489+ const Value& txid_v = find_value(o, "txid");
1490+ if (txid_v.type() != str_type)
I wrote a RPCTypeCheck(object,…) method for the raw transactions API that would save you a few lines of code and should give slightly nicer error messages.
Would be: RPCTypeCheck(o, boost::assign::map_list_of(“txid”, str_type)(“vout”, int_type));
More, simple RPC calls are preferred over making existing RPC calls ever more complicated.
“listunspent” displays the coins available for spending… let’s not make it more complicated than that.
1530+ BOOST_FOREACH(COutPoint &outpt, vOutpts) {
1531+ Object o;
1532+
1533+ o.push_back(Pair("txid", outpt.hash.GetHex()));
1534+ o.push_back(Pair("vout", (int)outpt.n));
1535+ }
and associated RPC "listlockunspent".
This is a memory-only filter, which is empty when a node restarts.
jgarzik
luke-jr
sipa
BitcoinPullTester
gavinandresen
xblitz
gmaxwell
Milestone
0.8.0