mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-01-31 11:54:24 +01:00
Improve error messages for on-chain related greenfield operations (#6393)
* Improve error messages for on-chain related greenfield operations * Fix test
This commit is contained in:
@@ -379,7 +379,7 @@ namespace BTCPayServer.Controllers.Greenfield
|
||||
if (network.ReadonlyWallet)
|
||||
{
|
||||
return this.CreateAPIError(503, "not-available",
|
||||
$"{network.CryptoCode} sending services are not currently available");
|
||||
$"This network only support read-only features");
|
||||
}
|
||||
|
||||
//This API is only meant for hot wallet usage for now. We can expand later when we allow PSBT manipulation.
|
||||
@@ -573,8 +573,11 @@ namespace BTCPayServer.Controllers.Greenfield
|
||||
WellknownMetadataKeys.MasterHDKey);
|
||||
if (!derivationScheme.IsHotWallet || signingKeyStr is null)
|
||||
{
|
||||
return this.CreateAPIError(503, "not-available",
|
||||
$"{network.CryptoCode} sending services are not currently available");
|
||||
var reason = !derivationScheme.IsHotWallet ?
|
||||
"You cannot send from a cold wallet" :
|
||||
"NBXplorer doesn't have the seed of the wallet";
|
||||
|
||||
return this.CreateAPIError(503, "not-available", reason);
|
||||
}
|
||||
|
||||
var signingKey = ExtKey.Parse(signingKeyStr, network.NBitcoinNetwork);
|
||||
|
||||
Reference in New Issue
Block a user