Bug fixes in wallet and related API

Fixes a few loose ends in the full cycle of sending coins,
accepting them, pushing that transaction to the pool and having it
mined. More specifically:

* The API output endpoint needs to be a UTXO endpoint, as the
server can't make any guarantee about having a spent output.
* Bubbling up HTTP not found errors.
* Wallet output status checker now handles spent outputs.
* Transaction pool validates the transaction before accepting it.
* Fixed the operation API routes.
* Fixed too greedy wallet coin selection loop.
This commit is contained in:
Ignotus Peverell
2017-06-12 16:41:27 -07:00
parent eb9cc7ef13
commit 6523966f9e
13 changed files with 107 additions and 24 deletions
+1 -2
View File
@@ -209,8 +209,7 @@ fn wallet_command(wallet_args: &ArgMatches) {
} else {
info!("Starting the Grin wallet receiving daemon...");
let mut apis = api::ApiServer::new("/v1".to_string());
apis.register_endpoint("/receive_coinbase".to_string(),
wallet::WalletReceiver { key: key });
apis.register_endpoint("/receive".to_string(), wallet::WalletReceiver { key: key });
apis.start("127.0.0.1:13416").unwrap_or_else(|e| {
error!("Failed to start Grin wallet receiver: {}.", e);
});